「SQL」集約関数COUNT()でレコード数を返すサンプル
書式
SELECT COUNT(カラム名)
FROM テーブル名
WHERE 条件式;
使用例
select
count(productid)
from
products;
結果
| COUNT(ProductID) |
|---|
| 77 |
Coding Changes the World
書式
SELECT COUNT(カラム名)
FROM テーブル名
WHERE 条件式;
使用例
select
count(productid)
from
products;
結果
| COUNT(ProductID) |
|---|
| 77 |