在phpmyadmin中使用嵌套查询错误

时间:2014-09-25 16:53:35

标签: mysql phpmyadmin

嘿伙计们,我尝试了一个类似

的mysql嵌套查询
SELECT test.babe,test.some
FROM (
SELECT  'password' AS babe

) test

工作正常

但是当我尝试了

SELECT babe,some
FROM (
SELECT  'password' AS babe
 SELECT 'username' AS some
) test

它会抛出错误,如

 #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 'username' AS some ) test' at line 5

是mysql的新手。希望你们能帮帮我.. !!

1 个答案:

答案 0 :(得分:1)

您可以将其重写为

SELECT babe, some
    FROM (
    SELECT 'password' AS babe, 'username' AS some
    ) test