GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 16-Jun-2004, 16:54
jugnu23 jugnu23 is offline
New Member
 
Join Date: Jun 2004
Posts: 1
jugnu23 is on a distinguished road
Unhappy

sql querry


Hi,

I have a staff table like this:

name year salary
============================
a 1998 50
a 1999 100
a 2000 200
a 2001 300
b 2000 200
b 2001 300


I want to get a new table from the above table:

name salary(1998 ) salary(1999) salary(2000) salary(2001)
================================================== =================
a 50 100 200 300
b 0 0 200 300

NB-no of years may increase over time so it should be a generic code
What's the SQL for this problem? I will invoke the sql code in my java code.
Thanks.
 
 

Recent GIDBlogToyota - 2008 July Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to save data to SQL 2000?? Sam C++ Forum 1 13-Feb-2004 12:54
SQL multiple languages query samtediou MySQL / PHP Forum 6 23-Jul-2003 13:09
3 line sql querry causes error, but i cant find the raeson norok MySQL / PHP Forum 2 01-Jul-2003 09:06
mysql vs sql - what is the difference zabell MySQL / PHP Forum 2 14-Jun-2003 16:32
Difference between MySQL and SQL pcxgamer MySQL / PHP Forum 2 14-Apr-2003 12:07

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 01:07.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.