Re: [SQL] query with =ALL

2004-06-14 Thread Stephan Szabo
On Mon, 14 Jun 2004, Tom Lane wrote: > "Jaime Casanova" <[EMAIL PROTECTED]> writes: > > AND > > CPA.cur_paralelo = ALL (SELECT cur_paralelo FROM aca_t_curso ...) > > Wait a second ... we are all overthinking the problem. The subselect > returns three *different* values. It is not possible for a

Re: [SQL] query with =ALL

2004-06-14 Thread Jaime Casanova
You're not expressing yourself clearly, because as far as I can understand you there are guaranteed to be no such results. regards, tom lane ok, the output i want is equivalent to: SELECT CPA.rub_codigo, RUB.rub_descripcion, CPA.cpa_valor, CPA.cpa_fechavencimiento FROM rec_m_cuadropagos CPA, re

Re: [SQL] query with =ALL

2004-06-14 Thread Tom Lane
"Jaime Casanova" <[EMAIL PROTECTED]> writes: >> Perhaps you meant "= ANY"? > Not really becuase ANY has the same efect that IN and what i want is all the > results that are equal in all the rows in any of the cur_paralelo values. > But must be in all the cur_paralelo or nothing. You're not expr

Re: [SQL] query with =ALL

2004-06-14 Thread Jaime Casanova
Hi all, > AND > CPA.cur_paralelo = ALL (SELECT cur_paralelo FROM aca_t_curso ...) Wait a second ... we are all overthinking the problem. The subselect returns three *different* values. It is not possible for any CPA.cur_paralelo values to be simultaneously equal to all three. So this test certain

Re: [SQL] query with =ALL

2004-06-14 Thread Tom Lane
"Jaime Casanova" <[EMAIL PROTECTED]> writes: > AND > CPA.cur_paralelo = ALL (SELECT cur_paralelo FROM aca_t_curso ...) Wait a second ... we are all overthinking the problem. The subselect returns three *different* values. It is not possible for any CPA.cur_paralelo values to be simultaneously eq

Re: [SQL] query with =ALL

2004-06-14 Thread Jaime Casanova
> On Mon, 14 Jun 2004, Jaime Casanova wrote: > > > On Mon, 14 Jun 2004, Jaime Casanova wrote: > > > > > i have an strange result here, i'm using 7.4.2 on redhat 8 > > > > > > i have a query like this > > > > > > SELECT CPA.rub_codigo, RUB.rub_descripcion, CPA.cpa_valor, > > > CPA.cpa_

Re: [SQL] query with =ALL

2004-06-14 Thread Stephan Szabo
On Mon, 14 Jun 2004, Jaime Casanova wrote: > On Mon, 14 Jun 2004, Jaime Casanova wrote: > > > i have an strange result here, i'm using 7.4.2 on redhat 8 > > > > i have a query like this > > > > SELECT CPA.rub_codigo, RUB.rub_descripcion, CPA.cpa_valor, > > CPA.cpa_fechavencimiento > > FROM

Re: [SQL] query with =ALL

2004-06-14 Thread Jaime Casanova
On Mon, 14 Jun 2004, Jaime Casanova wrote: > i have an strange result here, i'm using 7.4.2 on redhat 8 > > i have a query like this > > 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.e

Re: [SQL] query with =ALL

2004-06-14 Thread Jaime Casanova
Jaime Casanova wrote: Hi all, i have an strange result here, i'm using 7.4.2 on redhat 8 i have a query like this [snip] this query proves that its result is 'A', 'B', 'C' any idea, is something wrong in my thinking? Do you have any null values involved? That might well interfere (though I admit

Re: [SQL] query with =ALL

2004-06-14 Thread Richard Huxton
Jaime Casanova wrote: Hi all, i have an strange result here, i'm using 7.4.2 on redhat 8 i have a query like this [snip] this query proves that its result is 'A', 'B', 'C' any idea, is something wrong in my thinking? Do you have any null values involved? That might well interfere (though I admit I

Re: [SQL] query with =ALL

2004-06-14 Thread Stephan Szabo
On Mon, 14 Jun 2004, Jaime Casanova wrote: > i have an strange result here, i'm using 7.4.2 on redhat 8 > > i have a query like this > > 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

[SQL] query with =ALL

2004-06-14 Thread Jaime Casanova
Hi all, i have an strange result here, i'm using 7.4.2 on redhat 8 i have a query like this 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