pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
a query with = ALL
3+ messages / 2 participants
[nested] [flat]

* a query with = ALL
@ 2004-06-14 17:06  Jaime Casanova <el_vigia_ec@hotmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Jaime Casanova @ 2004-06-14 17:06 UTC (permalink / raw)
  To: pgsql-sql

Hi all,

some more info a think can be useful to probe there is somting wrong.

I pointed that the query

select cur_paralelo from rec_m_cuadropagos WHERE ent_codigo = 1 AND
                                                                         
sec_codigo = 1 AND
                                                                         
ani_codigo = '2004-2005' AND
                                                                         
cic_codigo = 1 AND
                                                                         
esp_codigo = 0 AND
                                                                         
cur_codigo = 1
intersect
SELECT cur_paralelo FROM aca_t_curso WHERE ent_codigo = 1 AND
                                                                         
sec_codigo = 1 AND
                                                                         
ani_codigo = '2004-2005' AND
                                                                         
cic_codigo = 1 AND
                                                                         
esp_codigo = 0 AND
                                                                         
cur_codigo = 1

brings 'A ', 'B ', 'C ' well when i cHange the real query

SELECT CPA.rub_codigo, RUB.rub_descripcion, CPA.cpa_valor, 
CPA.cpa_fechavencimiento
FROM rec_m_cuadropagos CPA, rec_m_rubro RUB
WHERE RUB.ent_codigo = CPA.ent_codigo AND RUB.rub_codigo = CPA.rub_codigo 
AND
      CPA.ent_codigo = 1 AND CPA.sec_codigo = 1 AND CPA.ani_codigo = 
'2004-2005' AND
      CPA.cic_codigo = 1 AND CPA.esp_codigo = 0 AND CPA.cur_codigo = 1 AND
      CPA.cur_paralelo = 'A '

then it brings the result that it would but when i do the same with =ALL it 
doesn't work

thanx in advance,

Jaime Casanova

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: a query with = ALL
@ 2004-06-14 18:51  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Jaime Casanova <el_vigia_ec@hotmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2004-06-14 18:51 UTC (permalink / raw)
  To: Jaime Casanova <el_vigia_ec@hotmail.com>; +Cc: pgsql-sql

"Jaime Casanova" <el_vigia_ec@hotmail.com> writes:
> brings 'A ', 'B ', 'C ' well when i cHange the real query

Given that you spelled it like that, I wonder whether you aren't
confused about the behavior of cross-data-type comparisons.  If
one column is char(n) and the other is text or varchar(n) then you
may get results you didn't expect.  These types have different ideas
about whether trailing blanks are significant or not.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: a query with = ALL
@ 2004-06-14 19:11  Jaime Casanova <el_vigia_ec@hotmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Jaime Casanova @ 2004-06-14 19:11 UTC (permalink / raw)
  To: pgsql-sql

>"Jaime Casanova" <el_vigia_ec@hotmail.com> writes:
>>brings 'A ', 'B ', 'C ' well when i cHange the real query

>Given that you spelled it like that, I wonder whether you aren't
>confused about the behavior of cross-data-type comparisons.  If
>one column is char(n) and the other is text or varchar(n) then you
>may get results you didn't expect.  These types have different ideas
>about whether trailing blanks are significant or not.

both CPA.cur_paralelo and the cur_paralelo obtained in the subquery are 
char(2) i assume there are no problem, i'm wrong?

thanx in advance,

Jaime Casanova

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2004-06-14 19:11 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-06-14 17:06 a query with = ALL Jaime Casanova <el_vigia_ec@hotmail.com>
2004-06-14 18:51 ` Tom Lane <tgl@sss.pgh.pa.us>
2004-06-14 19:11 Re: a query with = ALL Jaime Casanova <el_vigia_ec@hotmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox