Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL about one field
Message
 
À
05/01/2007 07:47:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01182738
Message ID:
01182743
Vues:
9
>Dear Expert
>
>Table1 has two fields as
>date d(8)
>no n(1)
>
>Field no has numbers from 1 to 9
>I am making a SQL to sum different type of vehicles.
>
>Please make following SQL enable to show correct data
>
>
>select date1,;
>	sum(iif(no = 1, no, $0)) as truck,;
>	sum(iif(no = 2, no, $0)) as trolly,;
>	sum(iif(no = 3, no, $0)) as troller,;
>	sum(iif(no = 4, no, $0)) as ttroler,;
>	sum(iif(no = 5, no, $0)) as tanker,;
>	sum(iif(no = 6, no, $0)) as bcart,;
>	sum(iif(no = 7, no, $0)) as ccart,;
>	sum(iif(no = 8, no, $0)) as dcart,;
>	sum(iif(no = 9, no, $0)) as other,;
>	count(no) as veh,;
>	from table1;
>	group by 1;
>	into table tmp
>
I just saw that you have ,; after COUNT(), change this line:
count(no) as veh,;
to
count(no) as veh; && No comma
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform