1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

SELECT vs COUNT

Posted at

<経緯>
任意のテーブルから条件に合うレコードの有無を調べる処理のコードレビューを行っていた。
そこの処理でCOUNT関数を使ったSQLを発行していて、個人的にはSELECT文の方がシンプルなのにな~と思ったが、一般的にはどうなのか気なった。

皆さんは、どう思いますか?
(例文)
SELECT 〇〇 FROM △△ WHERE XX = □□
vs
SELECT COUNT(*) FROM △△ WHERE XX = □□

1
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?