![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 4 of 4 total |
![]() |
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 ![]() | 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 ![]() | 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 Wednesday, July 2, 2025 at 06:46 PM | Privacy Policy![]() © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |