Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is wrong with this SQL Select?
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01424146
Message ID:
01424295
Vues:
35
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform