I have a simple database with two tables:
dates (ID
- PK, data
- text):
ID | data
1 | 2013-02-03
2 | 2012-10-06
3 | 2014-04-22
and rate (ID
- PK, dataNR
- FK from dates(ID
), value
(range 0-6), userNR
(from other base - it's not important):
ID | value | dataNR | userNR
1 | 3 | 1 | 1
2 | 5 | 2 | 1
3 | 2 | 3 | 2
and when I use this command:
SELECT rate.ID, rate.value, dates.data, rate.userNR
FROM rate
INNER JOIN date ON rate.dataNR = dates.ID
I believe the result would be:
ID | value | dataNR | userNR
1 | 3 | 2013-02-03 | 1
2 | 5 | 2012-10-06 | 1
3 | 2 | 2014-04-22 | 2
but I would like to get:
userNr | 2013-02-03 | 2012-10-06 | 2014-04-22
1 | 3 | 5 |
2 | | | 2
How can i get it? I would like to add that it will be connect with c# (component datagridView, well it maybe shows new ways to result?).