Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 4 of 4 total |
2 queries in 1, help please |
Fri, Dec 5 2008 7:20 AM | Permanent Link |
Aaron Taylor | i wish to return many fields from 1 table and 1 field from another
SELECT * FROM Table1 WHERE field = Parameter SELECT field FROM Table2 WHERE field = Table1.field this works but only returns records where ImageID has a value. i need all fields from Table1 regardless. SELECT Q.*, I.Image FROM Table1 Q, Table2 I WHERE Q.QuoteNumber = :QuoteNumber AND Q.ImageID = I.ImageID |
Fri, Dec 5 2008 7:46 AM | Permanent Link |
Fernando Dias Team Elevate | Aaron,
You must use an OUTER Join: SELECT Q.*, I.Image FROM Table1 Q LEFT OUTER JOIN Table2 I ON Q.ImageID = I.ImageID WHERE Q.QuoteNumber = :QuoteNumber -- Fernando Dias [Team Elevate] |
Fri, Dec 5 2008 7:47 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Aaron
I think you need a LEFT OUTER JOIN but could well be wrong since I rarely get these right. SELECT Q.*, I.Image FROM Table1 Q LEFT OUTER JOIN Table2 I WHERE Q.QuoteNumber = :QuoteNumber AND Q.ImageID = I.ImageID Roy Lambert |
Sun, Dec 7 2008 6:11 AM | Permanent Link |
Aaron Taylor | thanx guys
Fernandos script worked, YAY |
This web page was last updated on Monday, April 29, 2024 at 05:23 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |