I need to come up with a SQL Server statement that will return three rows: a grouped text row, and two value rows based on two numeric rows within the table. I can best explain by giving the table layout.tblTable:Text1 Value1 Value2========= ========== ==========a 3 9a 4 1b 7 3b 6 5c 3 6c 1 5
Basically, I need a query that will return the Text1 value, the number of rows where Value1 is greater than Value2 and the number of rows where Value2 is greater than Value1, both grouped by Text1. So the results would look like this.Results:Text1 Expr1 (Value1 > Value2) Expr2 (Value2 > Value1)======== ======================== ========================a 1 1b 2 0c 0 2
Thanks.