Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Queries Return Mixed Results
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01124689
Message ID:
01124697
Views:
12
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform