集計関数
COUNT
クエリ条件に一致する行の数を返します。
SELECT COUNT(*) FROM OEInvoices WHERE Allowpartialshipments = 'Yes'
COUNT(DISTINCT)
クエリ条件に一致する、null 以外の個別のフィールド値の数を返します。
SELECT COUNT(DISTINCT InvoiceUniquifier) AS DistinctValues FROM OEInvoices WHERE Allowpartialshipments = 'Yes'
AVG
カラムの値の平均を返します。
SELECT ApprovedLimit, AVG(AnnualRevenue) FROM OEInvoices WHERE Allowpartialshipments = 'Yes' GROUP BY ApprovedLimit
MIN
カラムの値の最小値を返します。
SELECT MIN(AnnualRevenue), ApprovedLimit FROM OEInvoices WHERE Allowpartialshipments = 'Yes' GROUP BY ApprovedLimit
MAX
カラムの値の最大値を返します。
SELECT ApprovedLimit, MAX(AnnualRevenue) FROM OEInvoices WHERE Allowpartialshipments = 'Yes' GROUP BY ApprovedLimit
SUM
カラムの値の合計を返します。
SELECT SUM(AnnualRevenue) FROM OEInvoices WHERE Allowpartialshipments = 'Yes'