oracle行转列
每次都忘,每次都要先找度娘,留个记录。 SELECT lower(a.GRANTOR), lower(a.TABLE_SCHEMA), lower(a.TABLE_NAME), lower(a.GRANTEE), LISTAGG(a.privilege, ',') WITHIN GROUP(ORDER BY privilege) privilege FROM all_tab_privs a where a.GRANTOR IN ('GIS', 'HIS') and a.GRANTEE = 'GISMEI' group by a.GRANTOR, a.TABLE_SCHEMA, a.TABLE_NAME, a.GRANTEE