gpt4 book ai didi

MySQL错误: Every derived table must have its own alias

转载 作者:行者123 更新时间:2023-11-30 00:43:40 29 4
gpt4 key购买 nike

我收到此错误

"Every derived table must have its own alias"

当我运行此查询时

SELECT firstname, lastname, artistId
FROM artist
WHERE artistId=(
SELECT artistId
FROM roles
WHERE movieCode ='$movie[movieCode]' and role = 'Director'
) a

最佳答案

$row1=mysqli_query($conn,"
SELECT firstname, lastname, artistId
FROM artist WHERE
artistId=(SELECT artistId FROM roles WHERE movieCode ='$movie[movieCode]' and role = 'Director') AS table_alias ")or die(mysqli_error($conn));

这应该可行,每个子查询都必须有一个别名“AS”。

关于MySQL错误: Every derived table must have its own alias,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21568030/

29 4 0