#navi(ORACLE)

*ORACLE/COUNT [#f233449d]

データー件数を数える集計ファンクション

**テーブルの件数を数える (総数) [#w714ae58]

 select count(*) from table1;

**データーの件数を数える (重複していないものだけ、データーの種類を数える) [#tda1acf3]

 select count(distinct field1) from table1;
または
 select count(*) 
     from ( select distinct field1
            from table1);

**ダブっている件数を数える [#nd9af1d8]

テーブル table1 の、フィールド field1 のダブっている(重複している)ものと、その件数を抽出する。

 select field1, cnt
     from ( select field1, count(*) as cnt 
            from table1
            group by field1)
     where cnt > 1);

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS