Jump to content

Hide Duplicates


RedInjection

Recommended Posts

Hello all!

 

I am learning SQL and from what I understand DISTINCT is what I need to hide duplicates?

SELECT provider FROM categories ORDER BY provider

In my table I have several 'provider' that are duplicates, I don't want to delete them but i just want to hide them, what is the best practice of doing this?

Link to comment
Share on other sites

Perhaps, but when dealing with OP's, experience shows Op's are mostly not doing things correctly. Based on this OP's other threads, it just enforces that. I go in for the most part assuming the OP is doing things wrong rather than speculate.

 

 

OP, if you can post an SQL dump with your tables and sample data we can let you know if you have any issues that need to be addressed. Your DB structure is the foundation of all the code you are going to write to manage it. If your DB is not right, then your code is not going to be right.

 

 

Right or wrong, at this point in the thread I will assume provider is not a foreign key to the id in the providers table and is likely duplicated text. The only thing that should be in that table is the provider_id.

Edited by benanamen
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.