|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Strange SQL query results... Help!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 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/ ML ha scritto:
> Because there are no corresponding rows in the outer table? Check the WHERE Sloved!> 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/ Was a time format problem! Really thank to helped me to point out the problem! Masterx81 wrote:
> Ho to all... Because your derived table is not returning a matching row to your> 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??? risorse table for that ID_RISORSA. Looks like you forgot the quotes around the date value.
-- Show quoteArnie Rowland, Ph.D. Westwood Consulting, Inc Most good judgment comes from experience. Most experience comes from bad judgment. - Anonymous "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??? > |
|||||||||||||||||||||||