Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL about one field
Message
 
To
05/01/2007 07:47:26
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01182738
Message ID:
01182742
Views:
13
>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
>
What exactly didn't work? This SELECT looks fine to me?
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform