Every derived table must have its own alias - error when using multiple SELECT statements

后端 未结 1 1050
旧巷少年郎
旧巷少年郎 2021-01-27 19:06

I\'m trying to use multiple SELECT statements in a query to get data from the database but I get an error. The query is:

SELECT * 
        FROM (SELECT * 
               


        
相关标签:
1条回答
  • 2021-01-27 19:49

    The from table needs an alias

    SELECT * 
            FROM (SELECT * 
                  FROM players 
                  WHERE lid = 0) as T
            WHERE NOT EXISTS (SELECT * 
                              FROM players 
                              WHERE lid = 1)
    

    Will work

    Though the query seems to make no sense. It is not a syntax error anymore

    0 讨论(0)
提交回复
热议问题