Home > database >  PL/SQL based on a field grouping query the number of the other two fields
PL/SQL based on a field grouping query the number of the other two fields

Time:01-29

Now there is a table, the table name t_tq, I want to query OPER_NAME according to P_ORGNAME grouping and ORG_NAME, the number of the SQL what to write?

CodePudding user response:

The select P_ORGNAME, count (distinct OPER_NAME), count (distinct ORG_NAME) from the TAB group by P_ORGNAME
  • Related