Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help on sql-query
Message
From
11/09/2008 07:37:39
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
11/09/2008 02:34:50
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01346517
Message ID:
01346543
Views:
7
select empno, iif(year=2004, amt, $0) as amt2004, iif(year=2005, amt, $0) as amt2005)...
  from MyTable;
  group by empno
>I have a table with values
>
>empno year amt
>A 2004 45.23
>A 2005 54.56
>A 2006 89.56
>B 2004 44.33
>B 2005 22.15
>B 2006 48.98
>C 2004 55.00
>C 2005 56.13
>C 2006 44.56
>
>
>How can I have a table that will appear like this
>empno 2004 2005 2006
>A 45.23 54.56 89.56
>B 44.33 22.15 48.98
>C 55.00 56.13 44.56
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform