php - select statement without including duplicate data -


i trying select database because database duplicate data , item names in each data may or may not duplicated. please @ example below understand more

table shoe

shoeid   pid  name  1         1    green 2         1    green 3         2     red 4         3     red 

thats simple example.

how can select name , pid table dont want see repeated numbers or names. example don't want see red or green or whatever color have in database more once. please remember have on 100 colors in database. same thing apply pid

use distinct

http://www.mysqltutorial.org/mysql-distinct.aspx
http://www.w3schools.com/sql/sql_distinct.asp

this might want

this gives unique results

select distinct name, pid shoe; 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -