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

后端 未结 8 1171
失恋的感觉
失恋的感觉 2020-12-10 03:55

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%]
         


        
8条回答
  •  北荒
    北荒 (楼主)
    2020-12-10 04:37

    LIKE does not make sense in your context, as it either matches or it does not, but it does not establish groups. You will have to use string functions that parse the column values into what makes sense for your data.

提交回复
热议问题