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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -