Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Selecting first record
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00633484
Message ID:
00634276
Vues:
23
Why would you need the "IN" subquery?

>Coming in late ... but what about this?
>
>
>
>select
> o.customerId,
> o.orderId,
> . . .
>FROM
> orders o
>WHERE
> o.orderid IN (
> SELECT TOP 1
>  o1.orderid
> FROM
>  orders o1
> WHERE
>  o1.customerId = o.customerID
> ORDER BY
>  o1.orderdate)
>
>
>
>-Mike
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform