Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Statement
Message
De
16/05/2003 05:50:24
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00789139
Message ID:
00789142
Vues:
20
Neil

Something like this?
SELECT *;
  FROM Table;
 WHERE (Type = "Sample" ;
   AND Id IN (SELECT Id FROM Table T WHERE T.Id = Table.Id AND T.Type = "Technical"));
    OR Type = "Technical"
   AND Id IN (SELECT Id FROM Table Ta WHERE Ta.Id = Table.Id AND Ta.Type = "Sample"))
There may be an easier way.

Kev

>I am trying to produce a list of records from one table. The records have a number associated with them and a description. In addition to this they have a type which is either Sample or Technical. For example:
>
>0001 Car Sample
>0002 Boat Sample
>0003 Caravan Sample
>0004 Lorry Sample
>0005 Train Sample
>0001 Car Technical
>0002 Boat Technical
>0003 Caravan Technical
>
>I want to list (SQL) those records where there is a sample and an eqivalent technical type. So taking the above into account if I run the query I will get the following:
>
>0001 Car Sample
>0002 Boat Sample
>0003 Caravan Sample
>0001 Car Technical
>0002 Boat Technical
>0003 Caravan Technical
>
>This will give me a list of results where the sample records have equivalent technical records.
>
>Many Thanks
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform