Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
macuser
Starting Member
2 Posts |
Posted - 2013-12-05 : 01:55:15
|
I have select:select *from serviceorders as zlecenie--join orderitems as linijki on linijki.serviceorder_id = zlecenie.idwhere zlecenie.id = 38table: serviceorders(headers) is joined to orderitems(items). In above case(id=38) - I have serviceorder, but i don't have orderitems(in remaining case data are present in both tables).If I ask only for serviceorders=38 - I receive result, but if I ask about orderitems too I will receive empty result(but I need data from serviceorders(such Name, adress).How can I ask about data from serviceorders in case when orderitems is empty but I need data from serviceorders(such Name, adress)? |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-12-05 : 02:08:24
|
[code]select *from serviceorders as zlecenieleft outer join orderitems as linijki on linijki.serviceorder_id = zlecenie.idwhere zlecenie.id = 38[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
macuser
Starting Member
2 Posts |
Posted - 2013-12-05 : 02:54:21
|
many thanks, it works! |
|
|
|
|
|