query to find the unapproved contacts -> PGSQL

query to find the unapproved contacts -> PGSQL

Below is the query to find the unapproved contacts -> PGSQL-> can be used from version 11

SELECT aaauser.User_id AS "User ID",
aaauser.first_name "First name",
aaauser.last_name "Last name",
hd.id "Portal ID",
hd.displayname "Portal Name",
sduser.status FROM PortalUsers ptu
LEFT JOIN SDUser sduser ON ptu.USERID=sduser.USERID
LEFT JOIN AaaUser aaauser ON sduser.USERID=aaauser.USER_ID
Left Join helpdeskdetails hd on ptu.helpdeskid = hd.id where sduser.status = 'UNAPPROVED'

                    New to ADSelfService Plus?