Displaying multiple totals in one table from Oracle
I am trying to calculate complete rows in a table named DRAWING with the following query: Select field, platform, counter (doc_id) as total from draw group by field, platform;
but I also need to display total attachments / no attachments for each platform
SQL:
select the field, platform, counter (doc_id) attached to the drawing, where file_bin is not group zero by field, platform;
select field, platform, counter (doc_id) as non_attached from drawing, where file_bin is group zero by field, platform;
Is there a way to combine 3 values in a view? eg Field, Platform, Total, Pinned, Unspecified [/ p>
thanks to Douglas Tosie's suggestion, I was able to use the case method instead.
select field, Platform, count (doc_id) as total, Amount (CASE WHEN file_bin is null THEN 1 WHEN file_bin is not null THEN 0 END) as attached Amount (CASE WHEN file_bin is null THEN 0 WHEN file_bin is not null. THEN 1 END) as non_attached from drawing, where doc_id is not null group by field, platform
perfect fit!!
Thanks again Douglas