User Profile

Collapse

Profile Sidebar

Collapse
Daniel Lee
Daniel Lee
Last Activity: Oct 9 '07, 08:50 PM
Joined: Sep 13 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Daniel Lee
    replied to Having trouble with GROUP BY ...
    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
    ------------------------------------------------------...
    See more | Go to post

    Leave a comment:


  • Daniel Lee
    replied to Having trouble with GROUP BY ...
    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
    ------------------------------------------------------...
    See more | Go to post

    Leave a comment:


  • Daniel Lee
    replied to Having trouble with GROUP BY ...
    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...
    See more | Go to post

    Leave a comment:


  • Daniel Lee
    started a topic Having trouble with GROUP BY ...

    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"...
    See more | Go to post
No activity results to display
Show More
Working...