+ 3
How to select unique value in a column
I have a set of value like 5,5,6,2,7,6,7 and I want to write a SQL query to select the unique number only .how can I do that ?
5 odpowiedzi
+ 9
• you could set your coulmn as primary key so that values dont repeat
• incase you want your repititve values you can use the syntax SELECT DISTINCT column_name FROM table
+ 1
select distinct column_name from table_name;
0
use distinct
0
TO SELECT
Select Distinct(colname) from tablename;
TO MAKE IT UNIQUE PERMANENTLY
alter table tablename add unique key(colname);