sql - Remove duplicates with a criteria -
what trying remove duplicate row id duplicate , column in row equals null.
ex: id - website 1, www.domain.com 1, null 1, null 2, www.test.com 2, null
what should be:
1, www.domain.com 2, www.test.com
so doing, joining 2 tables together, , adding in results, issue 1 table has several records 1 id, there rows per id containing null value. how can remove duplicate records query when id has more 1 row , row equals null.
if duplicates have null
, don't need distinct
@ all:
select id, website table t website not null;
removing distinct
(if not necessary) improves performance.
Comments
Post a Comment