I am looking for a way to take the columns for an id to separate rows.
Ex.
Existing Table:
ID COL1 COL2 COL3
1 a b c
2 d e f
Desired Query Result:
ID COL
1 a
1 b
1 c
2 d
2 e
2 f
Thanks!
I have to write this crosstab report for an educational institution and it uses one table but the way the data needs to be presented as I stand now I have to combine 7 cross-tabs and paste them into excel.
The table has columns like classLevel(fresh, soph, sen, jun), collegeAttendStatus (new...
I'm trying to combine code values from different columns into one column to use in a crosstab report....concatinating comes close but I need the values on seperate rows not together on one.
data desired concat
key a b key a b cmb key a b cmb
123...
OH yeah!......that did the trick.
Major thanks PH.
although needed to add A alias for table in syntax:
SELECT A.id#, A.sourceID, A.Date
FROM yourTable A INNER JOIN (
SELECT id#, Min(Date) AS MinDate FROM yourTable GROUP BY id#
) AS M ON A.id# = M.id# AND A.Date = M.MinDate
However...when...
I need to retrieve ONE row for every source id that has the lowest date coinciding with each id number.
source table:
id# sourceID Date
1 a1 2-3-02
2 c4 3-7-01
2 d3 4-12-98
3 5f 6-3-95
4 d5 5-22-02
4 2w...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.