Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Statement
Message
 
 
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:
00789178
Vues:
22
Try
SELECT *;
	FROM mytable;
	WHERE id + Type IN ;
		(SELECT id + IIF(Type = "Sample", "Technical", type) FROM mytable)
>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
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform