This is a discussion on INSERT using SELECT results within the MySQL General forum forums, part of the MySQL category; --> Hi, I have a table LOCAIS with: id type desc 1 t1 blah blah 2 t1 uihuih 3 t2 ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, I have a table LOCAIS with: id type desc 1 t1 blah blah 2 t1 uihuih 3 t2 pokpokp I want to list only the distinct types and create a table with those results. I know how to list the distinct and i thought i got the insert right, but it doesnt work: INSERT INTO ztipos('type') SELECT DISTINCT type FROM locais Whats wrong with that command? I want the result to be: results table ZTIPOS: id type 1 t1 2 t2 Thanks Miguel |