I am trying to use ResultSetMetaData to frame a SQL query for checking if there are duplicate records in a table dynamically.
The query for checking duplicate records will look like this
select
col1,
col2,
col3
from Table A
group by
col1,
col2,
col3
having count(*)>1
Most of this code is boilerplate and i can extract all the columns of the table using ResultSetMetaData. But I am not sure how to do this in an elegant way and handle the last missing comma.