I have the following query:
(The date above is just a UNIX timestamp from yesterday)
SELECT DISTINCT s.SUPPLIER_CODE AS SupplierCode, l.SUPPLIER_NAME AS SupplierName from MEDMGR.CMTRS_TB_VALIDATED_SUPPLIERS s, MEDMGR.CMTRS_TO_BE_VALIDATED v, MEDMGR.CMTR_VALIDATION_SUPPLIER_LIST l where s.CMTR_ELID=v.CMTR_ELID and RECORD_DATE > 1412476555 and l.SUPPLIER_CODE= s.SUPPLIER_CODE and l.QUALITY_INDEX != -1
It appears that I will not be able to use a GROUP BY clause.
I need to add a COUNT of the distinct SUPPLIER_CODE and the number of times it appears in the result set without using a GROUP BY in the statement.
Results should look like this...
SUPPLIERCODE SUPPLIER_NAME SUPPLIERCODECN
SupplierA WidgetCo101 2
SupplierB Mikes Toy Co. 1
SupplierC Goober Enterprises 3