Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Problem
Message
 
 
To
04/02/2011 13:54:02
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01498808
Message ID:
01498812
Views:
49
Or this
SELECT * FROM mytable t1
  WHERE EXISTS (SELECT 1 FROM mytable WHERE Artnum = t1.Artnum AND Catnum = 'INT')
    AND EXISTS (SELECT 1 FROM mytable WHERE Artnum = t1.Artnum AND Catnum = 'ISR')
>
>Consider the following table:
>
>
>Artnum    Catnum
>111         INT
>111         ISR
>111         GRP
>222         INT
>222         RSA
>222         GRP
>
>
>I want a select statement that says 'give me all the records for a particular artnum WHERE the artnum belongs to a catnum of BOTH 'INT' and 'ISR'.
>
>This would produce the following list:
>
>
>111         INT
>111         ISR
>111         GRP
>
>
>Thanks,
>
>Yossi
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform