| SQL - Questions and Answers Have a SQL question? Post it here. First do a search to see if someone hasn't already answered it. |
|
||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
|
|||
How can I select a Field and then add that field as a column?I have a table eg
employee type value 001 salary 1500.23 001 expenses 120.00 002 salary 1600.50 003 salary 1600 003 bonus 300 And want the table to look like Employee salary expenses bonus 001 1500.23 120 0 Any ideas Thanks |
|
|||
|
Hi Sat,
From a discussion I had with a friend of mine: What you need is called a pivot table. I do not think it can be achieved with SQL92. I think however that some database servers have proprietary extensions for this e.g. the PIVOT statement in SQL 2005 (MS SQL), and I think Oracle also has the functionality. Dimitar |
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I make one field be a function of another? | stav | SQL - Questions and Answers | 1 | 01-23-2007 07:43 PM |
| How do I insert multiple new records from a web form field into an MS Access database? | Sean | SQL - Questions and Answers | 1 | 05-26-2006 05:34 AM |
| How do I ensure that a field in a table must contain values within a specific range? | irfanhab | SQL - Questions and Answers | 1 | 05-24-2006 04:46 AM |
| How to impose a check that a certain field can only contain a certain domain of values? | irfanhab | SQL - Questions and Answers | 1 | 05-24-2006 04:39 AM |