N
nc
Guest
Hi all,
I have a very very tough problem to be solved. I have a table which is the answer of a survey. It includes the field of userid and ans(contain the council the user belongs to and the quarter selected). The records are not unique because each user can be in more than 1 council and answer for more than 1 quarter for a particular council. Eg.
|userid |ans |ans_id|
-------------------------
|mychan |EHS |12345 |
|mychan |Q1 |12346 |
|ter |PS |15557 |
|ter |Q2 |15558 |
|mychan |PS |64598 |
|mychan |Q1 |64599 |
|ter |PS |46512 |
|ter |Q1 |46513 |
-------------------------
what i need to do is sort out a user with the council he/she belongs to and the corresponding quarter. Eg.
|userid |Council|Quarter|
---------------------------
|mychan |EHS |Q1 |
|mychan |PS |Q1 |
|ter |PS |Q1 |
|ter |PS |Q2 |
How to design the query??? i have tried all kinds of combination but still i couldn't get what i want. pls help!!! thanks...
I have a very very tough problem to be solved. I have a table which is the answer of a survey. It includes the field of userid and ans(contain the council the user belongs to and the quarter selected). The records are not unique because each user can be in more than 1 council and answer for more than 1 quarter for a particular council. Eg.
|userid |ans |ans_id|
-------------------------
|mychan |EHS |12345 |
|mychan |Q1 |12346 |
|ter |PS |15557 |
|ter |Q2 |15558 |
|mychan |PS |64598 |
|mychan |Q1 |64599 |
|ter |PS |46512 |
|ter |Q1 |46513 |
-------------------------
what i need to do is sort out a user with the council he/she belongs to and the corresponding quarter. Eg.
|userid |Council|Quarter|
---------------------------
|mychan |EHS |Q1 |
|mychan |PS |Q1 |
|ter |PS |Q1 |
|ter |PS |Q2 |
How to design the query??? i have tried all kinds of combination but still i couldn't get what i want. pls help!!! thanks...