I am migrating MYSQL to MS-SQL. MYSQL script works fine
when use * with GROUP BY group_num and it shows all fileds in each row.
but Mssql doesn't support SELECT * and GROUP BY one_column.
id , group_num , issue, customer_name
1 , [1] , Wiper , john
------------------------------------------------------
2 , [3], Transmission , bill
------------------------------------------------------...
User Profile
Collapse
-
Your worst guess was right. There are duplicate group_nums
I tried JOIN but didn't work.
id , group_num , issue
1 , 1 , A
------------------------------------------------------
2 , 1 , B
------------------------------------------------------
3 , 2 , C
------------------------------------------------------
4 , 2 , D
------------------------------------------------------...Leave a comment:
-
Thanks for your help. But, that's not exactly what I want.
There are more columns other than group_num and I'd like to display all other colunms based on the group_num displayed.
What I want to see is that other columns lined up according to the group numbers resulted from your SQL query.
Thanks...Leave a comment:
-
Having trouble with GROUP BY ...
SELECT TOP 25 *
FROM new_ticket
WHERE group_num NOT IN (SELECT TOP 75 no FROM new_ticket ORDER BY no DESC)
ORDER BY group_num DESC
I am using the above method to get pagination with PHP Script.
It is running on MS SQL Server 2005 Express Edition.
After long been trying, I haven't found a way to get them grouped.
I modified very last line "GROUP BY group_num"...
No activity results to display
Show More
Leave a comment: