Home All Groups Group Topic Archive Search About

Strange SQL query results... Help!

Author
10 Aug 2006 10:41 AM
Masterx81
Ho to all...
I'm stuk with a problem on a simple query...

SELECT    risorse.ID_Risorsa,risorse.CODICE,a.ID_Ordine
FROM    risorse
LEFT JOIN (select * from lavorazioni WHERE
lavorazioni.DATA_INIZIO<25/08/2006) a
ON  Risorse.ID_RISORSA = a.ID_RISORSA

Why this query doesn't return the a.ID_Ordine value???

Author
10 Aug 2006 10:54 AM
ML
Because there are no corresponding rows in the outer table? Check the WHERE
clause condition, and consider using ISO date format yyyymmdd or yyyy-mm-dd.

For a better answer post proper DDL, sample data and expected results.


ML

---
http://milambda.blogspot.com/
Author
10 Aug 2006 11:10 AM
Masterx81
ML ha scritto:

> Because there are no corresponding rows in the outer table? Check the WHERE
> clause condition, and consider using ISO date format yyyymmdd or yyyy-mm-dd.
>
> For a better answer post proper DDL, sample data and expected results.
>
>
> ML
>
> ---
> http://milambda.blogspot.com/

Sloved!
Was a time format problem!

Really thank to helped me to point out the problem!
Author
10 Aug 2006 10:56 AM
Chris Lim
Masterx81 wrote:
> Ho to all...
> I'm stuk with a problem on a simple query...
>
> SELECT    risorse.ID_Risorsa,risorse.CODICE,a.ID_Ordine
> FROM    risorse
> LEFT JOIN (select * from lavorazioni WHERE
> lavorazioni.DATA_INIZIO<25/08/2006) a
> ON  Risorse.ID_RISORSA = a.ID_RISORSA
>
> Why this query doesn't return the a.ID_Ordine value???

Because your derived table is not returning a matching row to your
risorse table for that ID_RISORSA.
Author
10 Aug 2006 4:13 PM
Arnie Rowland
Looks like you forgot the quotes around the date value.

--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc

Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous


Show quote
"Masterx81" <enr***@je.net> wrote in message
news:1155206480.624848.267840@h48g2000cwc.googlegroups.com...
> Ho to all...
> I'm stuk with a problem on a simple query...
>
> SELECT    risorse.ID_Risorsa,risorse.CODICE,a.ID_Ordine
> FROM    risorse
> LEFT JOIN (select * from lavorazioni WHERE
> lavorazioni.DATA_INIZIO<25/08/2006) a
> ON  Risorse.ID_RISORSA = a.ID_RISORSA
>
> Why this query doesn't return the a.ID_Ordine value???
>

AddThis Social Bookmark Button