Ad Code

Update duplicate email values except first one in the sql table

@ What I want is to update duplicate values adding the "yes" value string to it except the first one.

UPDATE enqforms t1

JOIN ( SELECT enq_mobile, MIN(enq_id) t3id FROM enqforms t2 WHERE t2.enq_added_date='2023-01-01' GROUP BY enq_mobile, enq_serv_id ) t3 ON t1.enq_id > t3.t3id AND t1.enq_mobile = t3.enq_mobile

SET

    t1.enq_uplicate = 'yes'

WHERE

    t1.enq_added_date='2023-01-01'



Post a Comment

0 Comments