Microsoft
Software
Hardware
Network
Question : Left Join Distinct Rows only?
I was just wondering is it possible to do a left join and take the top row only?
My SQL is as follows
select * from orders o
left join user u on u.userId = o.userId
left join invoice i on i.orderId = o.orderID
Which returns 10 rows, but if I remove the last line I get 6 rows. This is because the invoice table holds a reference to the various items placed within an order.
I did think that the left join would only add onto the rows that existed from the select orders, and not append extra rows. Anyway is there a way to limit the join to the Top or Distinct only?
I really am not explaining this well...
Answer : Left Join Distinct Rows only?
you can try to use a subselect in left join:
left join (select distinct from table where something) tab1 on something
sorry i don't really understand your explanation, i hope at least this will be a small clue..
Random Solutions
GoogleToolbarUser_32.exe process using 50% of CPU
System.NullReferenceExcept<wbr />ion for Excel.Workbooks.Open (visual Studio
NetworkStream.DataAvailabl<wbr />e returns false
sql query using count
tool to compare 2 Folders
Sending and Receiving Data like a Dataset using WCF between two or more programs over internet without IIS Configurations
SCCM Application to delete old Computers from SCCM Database & Active Directory?
VB.NET: get control by name and Reflection performance
Raising Domain Functional Level from Windows 2000 to 2003
Need help with combobox not selecting the correct record