Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Some Help with Select statement
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00830332
Message ID:
00830362
Vues:
14
The trouble with an INNER JOIN is it will not find The Times and The Sunday Times and it is also not possible to specify the No Others bit.

I seem to be achieving less and less the more I look at this!

>An INNER JOIN will eliminate records that don't exist in the other table so try that between the customers and subscriptions table using an ON clause that lists the papers you are looking for.
>
>Also, include a GROUPBY Customer.ID if you really only want one record per customer and not multiple records if they subscribe to more than one paper.
>
>Cathy
>
>
>>Hi all,
>>Is it possible to produce a single select statement to achieve the following:-
>>
>>If you have a Customers table (Id, Name), an Items table (Id, Name) and a Subscriptions table (CustomerID, ItemId). The Subscriptions table will hold a record for each Item that a Customer subscribes too.
>>
>>Is it then possible to get all the Customers who subscribe to a specified list of Items and NO others.
>>
>>ie If this is a paper round I want to find all those customers who take the Times and the Sunday Times and NO other papers.
>>
>>Its the NO other papers bit that has me stumped at the moment. Any help greatly appreciated.
>>Caroline
Caroline
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform