MAX vs Top 1 - which is better?

前端 未结 7 1785
慢半拍i
慢半拍i 2020-12-03 02:35

I had to review some code, and came across something that someone did, and can\'t think of a reason why my way is better and it probably isn\'t, so, which is better/safer/mo

7条回答
  •  -上瘾入骨i
    2020-12-03 03:14

    They are different queries.

    The first one returns many records (the biggest a_date for each event_id found within a_primary_key = 5)

    The second one returns one record (the smallest a_date found within a_primary_key = 5).

提交回复
热议问题