Andrzej
August 25th, 2008, 05:47 PM
Hello
I use MS SQL 2000. I need to present some rows as new columns.
Thanks to help hspc (http://www.codeguru.com/forum/member.php?u=73157) I know how to do it but ...
I think that my query ( please find enclosed file ) is simply wrong.
To get result without error I need to add one extra column R.ReelGrade. Without this column I returned an error:
Column R.ReelGrade is invalid in the selected list because it is not contained in either an aggregatefunction or the GROUP BY clasue
I don't need to ORDER BY the second column. My oryginal query will SELECT at least 20 columns, I don't want to add 20 extra column to ORDER BY calsue.
Could you please tell me what my query should be.
PS
I found some info about it hereSQL GROUP BY techniques (http://weblogs.sqlteam.com/jeffs/archive/2005/12/14/8546.aspx) but it is not clear enough for me.
Thanks in advance
I use MS SQL 2000. I need to present some rows as new columns.
Thanks to help hspc (http://www.codeguru.com/forum/member.php?u=73157) I know how to do it but ...
I think that my query ( please find enclosed file ) is simply wrong.
To get result without error I need to add one extra column R.ReelGrade. Without this column I returned an error:
Column R.ReelGrade is invalid in the selected list because it is not contained in either an aggregatefunction or the GROUP BY clasue
I don't need to ORDER BY the second column. My oryginal query will SELECT at least 20 columns, I don't want to add 20 extra column to ORDER BY calsue.
Could you please tell me what my query should be.
PS
I found some info about it hereSQL GROUP BY techniques (http://weblogs.sqlteam.com/jeffs/archive/2005/12/14/8546.aspx) but it is not clear enough for me.
Thanks in advance