Using a SELECT statement within a WHERE clause

后端 未结 7 2214
孤街浪徒
孤街浪徒 2020-12-17 18:42
SELECT * FROM ScoresTable WHERE Score = 
  (SELECT MAX(Score) FROM ScoresTable AS st WHERE st.Date = ScoresTable.Date)

Is there a name to describe

7条回答
  •  半阙折子戏
    2020-12-17 19:22

    In your case scenario, Why not use GROUP BY and HAVING clause instead of JOINING table to itself. You may also use other useful function. see this link

提交回复
热议问题