| Sponsored Links |
| | #1 |
![]() | I am wanting to do an query on a database, im using mysql. i want to query 3 fields on a single table but want the results to comeout as just one field. it was a long shot but i tried the following which didnt work, but might explain what i want to do Code: SELECT dt7 AS year7, ict7 AS year7, art AS year7 WHERE sID=1; Thanks Nij |
| |
| | #3 |
![]() | the data is alphanumeric data...... i want to query 3 fields form the table return the results as if it was 3 entries from a single field in the table... so i would want them returned as year7 and the result would be 3 individual rows from the fields ict7, dt7, art7 etc..... |
| |
| | #5 |
![]() | that adds the values together..... i want the results from each field as 3 individual results. individual rows |
| |
| | #7 |
![]() | it would just make it easier to handle in PHP if i could get it to work like that, as i could just use the array.... Im trying to get my script to generate dynamic graphs |
| |
| | #8 |
![]() Join Date: Oct 2006 Location: Warwickshire
Posts: 91
Thanks: 1
Thanked 17 Times in 12 Posts
Rep Power: 7 | Hows about..... Code: (SELECT dt7 AS year7 WHERE sID=1) UNION ALL (SELECT ict7 AS year7 WHERE sID=1) UNION ALL (SELECT art7 AS year7 WHERE sID=1); |
| |
| | #9 |
![]() | thanks Iain.... i think u just hit the nail on the head, just what i was looking for and works aswell! Cheers mate! |
| |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Here's a question for you! | azrael78 | Hardware | 15 | 01-10-2007 10:33 AM |
| Win 2k PDC question | glennw | Windows | 2 | 27-09-2007 12:17 PM |
| dvd question | strawberry | Hardware | 3 | 24-08-2007 04:17 PM |
| Question | Elky | Recommended Suppliers | 48 | 07-11-2006 02:02 PM |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search Thread |
|
|





