![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Ciao, forse per voi sarą una cosa banale ma io non riesco. Ho due tabelle, clienti e ordini (un classico): clienti: id_cliente, cognome, nome ordini: id_ordini, merce, quantitą vorrei sapere quanti sono i clienti che hanno fatto almeno un ordine, dato che non tutti lo hanno fatto. Mi dareste un input per favore? Ciao e grazie. Remigio |
#3
| |||
| |||
|
|
On Oct 6, 11:57*am, remigio <linore... (AT) gmail (DOT) com> wrote: Ciao, forse per voi sarą una cosa banale ma io non riesco. Ho due tabelle, clienti e ordini (un classico): clienti: id_cliente, cognome, nome ordini: id_ordini, merce, quantitą vorrei sapere quanti sono i clienti che hanno fatto almeno un ordine, dato che non tutti lo hanno fatto. Mi dareste un input per favore? Ciao e grazie. Remigio Translation fromhttp://translate.google.com: Hello, perhaps you will be a trivial thing but I can not. I have two tables, customers and orders (a classic): customers: Customer_ID, surname, name orders: id_ordini, commodity, quantity I would like to know how many customers who have made at least one order, since not all did. *You give me input please? *Hello and thank you. Risposta (Answer): Avete bisogno di (you need): clientes: Customer_ID, surname, name ordines: id_ordini, commodity, quantity, Customer_ID SQL: SELECT Customer_ID, [name] FROM clientes WHERE Customer_ID IN (SELECT Customer_ID FROM ordines); o SELECT Customer_ID, [name] FROM clientes WHERE Customer_ID IN (SELECT Customer_ID FROM ordines WHERE OrdineDiData BETWEEN #2010-8-1# AND #2010-8-31#) ORDER BY [name]; James A. Fortune CDMAPos... (AT) FortuneJames (DOT) com |
![]() |
| Thread Tools | |
| Display Modes | |
| |