58
Views
12
Comments
Solved
How to Delete/remove Duplicate data from the table using Advance sql

Hi all,

Here i have inserted Employee table using advance SQL, when i try to view data got some duplicate data so i just want to remove those data i have return query but i am getting error like below and i am new to this tool

Could you help me?

Thank you :)


2024-05-22 06-12-56
Vignesh Prakash
Solution

Hi Aishwarya Patil,

Good Day!!

Please Create a Structure and use the structure to select the values from the table (your output aggregate and the select statement of your query has a mismatch).

Also you have missed a , before the count(*) in the above SQL, 

if More clarification are needed please share OML.

FYI - 
Query I have used 

Output of the above Query - 


Structure I have created 

Thanks,
Vignesh Prakash.

2024-03-09 13-34-23
Aishwarya Patil

Thank you Vignesh Prakash

2024-05-14 06-49-08
Karnika-EONE
Solution

Hi @aishwarya patil

1.You need to create Structure As you want.

Hope it helps.

thanks

Karnika.K

2024-05-14 06-49-08
Karnika-EONE

Hi @Aishwarya Patil

You can use "Distinct" keyword in your Query to remove Duplicate values.

Thanks

karnika

2024-03-09 13-34-23
Aishwarya Patil

Thank you Karnika-EONE for your suggestion, I have used that still i am getting duplicates 

2024-05-14 06-49-08
Karnika-EONE
Solution

Hi @aishwarya patil

1.You need to create Structure As you want.

Hope it helps.

thanks

Karnika.K

2024-03-09 13-34-23
Aishwarya Patil
2024-05-22 06-12-56
Vignesh Prakash
Solution

Hi Aishwarya Patil,

Good Day!!

Please Create a Structure and use the structure to select the values from the table (your output aggregate and the select statement of your query has a mismatch).

Also you have missed a , before the count(*) in the above SQL, 

if More clarification are needed please share OML.

FYI - 
Query I have used 

Output of the above Query - 


Structure I have created 

Thanks,
Vignesh Prakash.

2024-03-09 13-34-23
Aishwarya Patil

Thank you Vignesh Prakash

2024-03-22 09-17-23
Chandra Vikas Sharma

Hi Aishwarya,

You can please refer below discussion for remove duplicate record.

https://www.outsystems.com/forums/discussion/79807/duplicate-data/

thanks

CV


2024-03-09 13-34-23
Aishwarya Patil

Thanks CV 

2025-10-18 11-13-53
Ramesh subramanian

Hi,

please  create structure for those column (Employee table column )

and remove Execute Line 5.


Thanks,

Ramesh

2024-03-09 13-34-23
Aishwarya Patil

Yes now its working Thanks for response.


2021-11-12 04-59-31
Manikandan Sambasivam

SELECT    EmployeeID,    EmployeeName,    EmployeeEmail,    COUNT(*) OVER (PARTITION BY EmployeeName, EmployeeEmail) AS DuplicateCount FROM Employee HAVING COUNT(*) OVER (PARTITION BY EmployeeName, EmployeeEmail) > 1 ORDER BY EmployeeName, EmployeeEmail; 

  • SELECT clause: Selects the EmployeeID, EmployeeName, EmployeeEmail, and a count of duplicates.
  • COUNT(*) OVER (PARTITION BY ...): Calculates the number of occurrences of each combination of EmployeeName and EmployeeEmail.
  • HAVING COUNT(*) OVER (PARTITION BY ...) > 1: Filters the results to show only those rows where the count is greater than 1, indicating duplicates.
  • ORDER BY: Orders the results for easier reading and analysis
2025-04-22 05-54-18
Shashi Kant Shukla

Hi Aishwarya Patil,

First all you have to identify id`s of duplicate records and then you have to pass those id`s to delete sql statement in sql.


Regards

Shashi Kant Shukla

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.