Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Queries Return Mixed Results
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01124689
Message ID:
01124697
Vues:
9
>First I ran:
>
>
>select *
>  from media_order
>  where id = 3901733
>
>select *
>  from media_order_detail
>  where media_order = 3901733
>
>
>which returned 1 record for the first query and 0 records for the second. So I then
>ran this:
>
>select *
>  from media_order_detail
>  where media_order NOT IN
>    (select id
>       from media_order)
>
>
>which returned no records.
>
>Anyone know what's wrong here?

Nothing wrong :) what are you tring to do?

media_order has one record where id = 3901733 and media_order_detail does not have any records where media_order = 3901733 (i.e there are no child records for that particular parent)

Last select statement you are selecting the records from media_order_detail that does not have a parent in media_order (i.e. orphaned child records).

Einar
Semper ubi sub ubi.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform