Subject | Re: [firebird-support] Re: help with a select, i m out of ideas. |
---|---|
Author | Helen Borrie |
Post date | 2006-03-30T11:15:13Z |
At 09:07 PM 30/03/2006, you wrote:
C.cli_nome
FROM clientes C
WHERE NOT EXISTS (
SELECT 1 FROM vendas V
WHERE V.cli_cod=C.cli_cod
AND V.vnd_data BETWEEN '2006-1-01' AND '2006-1-31')
./hb
>Anyway, sorry about all those newbie questions, but i have another one ^^SELECT
>
>Now i need to make a report that shows all the clients that didnt buy
>anything on that month.. so i tried this:
>
>SELECT C.cli_nome
>FROM clientes C, vendas V
>WHERE (SELECT V.vnd_cod FROM vendas V, clientes C WHERE V.cli_cod=C.cli_cod)
>IS NULL AND V.vnd_data BETWEEN '2006-1-01' AND '2006-1-31'
>
>I dont really understand how subselects work so i just guessed it, and it
>seens that i ve guessed it wrong, cause it didnt work.
>
>Could you guys help me out with this too?
C.cli_nome
FROM clientes C
WHERE NOT EXISTS (
SELECT 1 FROM vendas V
WHERE V.cli_cod=C.cli_cod
AND V.vnd_data BETWEEN '2006-1-01' AND '2006-1-31')
./hb