sql - Duplicate MySQL rows -


i write query pick out rows same cottageid, from, , values, in case pick out rows id 991, , 992. table name datesbooked.

enter image description here

you can join table itself:

select d1.id,d2.id datesbooked d1    inner join datesbooked d2 on        d1.cottageid=d2.cottageid       , d1.from = d2.from       , d1.to = d2.to       , d1.id<d2.id 

that give duplicates. getting ones have lesser id following 1 (that way duplicates in right column, , originals in first one)


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -