tricky timetable based query

2004-06-18 Thread Sam Russo
I recieve a delimited file whose fields are:
day,slot,subject,room
An example of this file is:
2,1,Mat,R1
3,1,Sci,R6
1,2,Sci,R6
3,2,Mat,R3
1,3,Eng,R2
2,3,Eng,R5
1,4,Mat,R7
3,4,Eng,R9

I need a mysql query that will generate a timetable which looks like:
Day1Day2Day3
---
1   Mat R1  Sci R6
2   Sci R6  Mat R3
3   Eng R2  Eng R5
4   Mat R7  Eng R9

Any help would be appreciated
sam
**
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
**


A difficutl query I cannot do.

2002-01-09 Thread Sam Russo

I have a delimited file sent to me with students ID subjects and when they
do these subjects. This file (table) looks like:
 ID TimeSlotSubject
 
215 3   Eng1 
648 2   Maths2
901 4   French
215 2   Maths1
901 1   Science2
648 4   Art
215 1   Science1
901 3   Eng1

I need to produce the following output (on a web page using php and 
mysql) with a mysql query.

ID  1   2   3   4
215 Science1Maths1  Eng1
648 Maths2  Art
901 Science2Eng1
French

any help would be appreciated.
sam russo
[EMAIL PROTECTED]

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php