2
我有表“改为”使用所有不同的字母:MySQL查询获得跨行
id
name
insert into words values(null, 'one');
insert into words values(null, 'two');
insert into words values(null, 'three');
我需要找出,清楚,在所有使用的在桌子上的字母。 在这种情况下,结果将是:
o
n
e
t
w
h
r
其实我真的没有对如何做到这一点的线索。我发现一些似乎解决它的存储过程。通过将所有行添加到最终结果的行进行某种迭代。 有没有办法用纯SQL命令做到这一点?
Aren't程序纯粹的SQL命令?你是使用PHP还是只使用MySQL/SQL /等?看看[这](http://stackoverflow.com/questions/14950466/how-to-split-the-name-string-in-mysql) –
我可以用PHP做到这一点。我使用laravel和数据库种子。我可以用某种方式解决它。但它可以用单个sql查询来完成。 – oderfla
你必须创建一个功能来做到这一点。可能为每个角色使用SUBSTRING(colname,1,1)来单独获取它们。 –