LadyBird0 / SQL

0 stars 0 forks source link

DBA_GET_USERIDS_WITH_ISSUES #9

Open LadyBird0 opened 6 years ago

LadyBird0 commented 6 years ago

USE [HRNet] GO /** Object: StoredProcedure [dbo].[DBA_GET_USERIDS_WITH_ISSUES] Script Date: 08/29/2018 09:32:28 **/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: Admnsa -- Create date: <Create Date,,> -- Description: get abantu duplicated -- ============================================= ALTER PROCEDURE [dbo].[DBA_GET_USERIDS_WITH_ISSUES] -- Add the parameters for the stored procedure here

AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON;

WITH EMPLOYEE_CTE (ASSOCIATEDRECORDID) 
 as

( select ASSOCIATEDRECORDID from OC_USERS group by ASSOCIATEDRECORDID HAVING COUNT()>1
) SELECT
FROM OC_USERS WHERE OC_USERS.ASSOCIATEDRECORDID IN(SELECT ASSOCIATEDRECORDID FROM EMPLOYEE_CTE)

END