Tuesday, 5 August 2014

Selecting duplicate IDs in mysql

select column_name,count(*) from table_name group by column_name having count(*)>1;

Example:

select consignment_id,count(*) from trip_sheet_trip group by consignment_id having count(*)>1;

No comments: