gpt4 book ai didi

mysql - sql 子查询返回 "Every derived table must have its own alias"

转载 作者:太空宇宙 更新时间:2023-11-03 10:59:17 25 4
gpt4 key购买 nike

我在我的服务器上执行了这个查询并得到了

$query1="select clients.name AS client,
packages.pick AS pick,
packages.drop AS `drop`,
packages.created AS created,
packages.status AS status,
packages.id AS id,
packages.name AS package
from (packages join clients on(clients.id = packages.client_id))";

$result = $mysqli->query("select count(*) as num from ($query1)");

我得到了上面的错误,知道是什么导致了这个错误吗?

最佳答案

必须命名子查询:

from ($query1) as SubQueryAlias

关于mysql - sql 子查询返回 "Every derived table must have its own alias",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17213743/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com