layout
https://www.dropbox.com/s/6fu81cqsl25vksd/layout.png?dl=0
link to image
Example:
Create Statement:
create table rating
(
id int,
tieid int,
inspected datetime,
rate varchar(50)
);
Insert Statement:
insert into rating values
(1,1, '0000-00-00 00:00:00', 'E'),
(2,1, '2015-03-31 01:01:22', 'G'),
(3,1, '2015-02-26 01:01:22', 'B'),
(4,2, '0000-00-00 00:00:00', 'E'),
(5,2, '2015-03-31 01:01:22', 'F');
What Im trying to do is get an ouput with this data like such cant seem to figure out how to get the query correct for this
tieid | inspected1 | rate1| inspected2 | rate2| inspected3 | rate3|
1 | 0000-00-00 |E |2015-02-26 |B | 2015-03-31 |G |
2 | 0000-00-00 |E |2015-03-31 |F | | |
-------------------------------------------------------------------