Fastest way to determine if record exists

前端 未结 11 1180
清歌不尽
清歌不尽 2020-11-29 16:16

As the title suggests... I\'m trying to figure out the fastest way with the least overhead to determine if a record exists in a table or not.

Sample query:

11条回答
  •  悲&欢浪女
    2020-11-29 17:00

    SELECT COUNT(*) FROM products WHERE products.id = ?;
    

    This is the cross relational database solution that works in all databases.

提交回复
热议问题