You can use a CASE statement with an aggregate function. This is basically the same thing as a PIVOT function in some RDBMS: SELECT distributor_id, count(*) ...
確定! 回上一頁