There is a table allowed:

names | folders ------+-------- name1 | folder1 name2 | folder1 name3 | folder1 name4 | folder2 name5 | folder2 name6 | folder2 

I want the muscle to return the result of folder1, folder2 , that is, only 2 values ​​And I don’t know how to do it .... I don’t even know how to ask Google correctly.

  • one
    Your question is incomprehensible. You may be asking about how to select specific entries by ID. Then the answer is something like SELECT names, folders FROM table WHERE names = 'name1' or names = 'name2'. It is possible that you are asking how to limit the selection to a maximum of two elements. Then the answer is something like SELECT names, folders FROM table LIMIT 0,2 - but in general, in a good way, you need to specify the selection condition - AK
  • I need the result to be the values ​​of the folders. Those. maybe folder1, folder2, folder3 and so on to infinity. Return should only folder1, folder2, folder3, and not folder1, folder1, folder1, folder2, folder2, folder2, folder3, folder3, folder3, folder3.T.e. all column values, but unique. - GMK

2 answers 2

Use the DISTINCT statement:

 SELECT DISTINCT FOLDERS FROM TABLE; 
  • That's exactly what you need! Thank you very much. - GMK
 select * from `table` GROUP BY `folders`