facing problem in query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dashingashish
    New Member
    • Mar 2008
    • 1

    #1

    facing problem in query

    Is there any alternative for
    select count(distinct column_name) from table1
  • Stewart Ross
    Recognized Expert Moderator Specialist
    • Feb 2008
    • 2545

    #2
    Originally posted by dashingashish
    Is there any alternative for
    select count(distinct column_name) from table1
    I am just guessing here as you have provided very little to go on. I suspect you need to count the number of rows for each group of items in column_name. If so, the SQL below may help:
    [code=sql]SELECT [table1].[column_name], Count([table1].[column_name]) AS [Rows Counted]
    FROM [table1]
    GROUP BY [table1].[column_name];[/code]
    -Stewart

    Comment

    Working...