Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is wrong with this SQL Select?
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01424146
Message ID:
01424295
Views:
36
Basically, yes.

>I was wondering, if there are two rows/records that have the same value in ORDERNO field/column, how does SQL Server select one in the expression MIN(ORDERNO)? Is it random?
>
>
>>Try
>>
>>TEXT TO cSqlCommand  NOSHOW
>>select C1.*, C2.LASTNAME, C2.FIRSTNAME, C2.TELEPHONE1 
>>	from COMPANY C1 
>>		LEFT JOIN (SELECT LASTNAME, FIRSTNAME, TELEPHONE1, COMP_PK FROM PEOPLE p3	
>>       WHERE ORDERNO = (SELECT MIN(ORDERNO) FROM PEOPLE p4 where p3.comp_pk =p4.comp_pk )) C2 ON C1.COMP_PK  = C2.COMP_PK
>>ENDTEXT
>>
>>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform