T-SQL - GROUP BY with LIKE - is this possible?

Posted by fieldingmellish on Stack Overflow See other posts from Stack Overflow or by fieldingmellish
Published on 2009-10-30T02:46:12Z Indexed on 2010/06/05 13:42 UTC
Read the original article Hit count: 120

Filed under:
|
|

Is there a way to include a LIKE expression in a GROUP BY query? For example:

  SELECT Count(*) 
    from tblWhatever
GROUP BY column_x [LIKE %Fall-2009%]

column_x:

--------
BIOL-Fall_2009
HIST Fall_2009
BIOL Spring_2009

Result:

------
Fall_2009   2
Spring_2009 1

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server