How to create a sequence on selected values in MySQL?
问题 I'm trying to create a query which will select a team from a declared variable and then make the remaining teams "anonymous" by giving them generic brands and sequential IDs. For example, if my dataset has 3 different team names (ABC, DEF, and GHI), but I would only like the true value of the 1 chosen team (ABC) displayed. Here is the skeleton of the query I'm working with: SET @teamid = 123; SELECT CASE WHEN ID = @teamid THEN NAME ELSE 'Team' + ' - ' + SEQ END AS 'Team Name', SUM(TOTAL) AS