How can i prevent duplicate rows being selected in a select query?
I have a table with the following fields:
- name
- type
- user1
- user2
- user3
- date
My query requires me to select data for a particular user only at a time which is entered by the user at front end.. Say user enters 1, then the select query should retreive data for user1 only.
I am currently doing it like this:
select name,type,date from table1 order by user1;
But I'm getting redundant rows in the result??
what i am doing wrong? How to avoid these duplicate rows?
Please help...