我使用php来查询这个命令
WITH RECURSIVE ancestor as
(
SELECT name, parent_id
FROM organization
WHERE name=?
UNION ALL
SELECT e.name, e.parent_id
FROM organization e
INNER JOIN ancestor a
ON a.parent_id = e.name
)
SELECT phoneBook.phone
FROM ancestor
RIGHT JOIN phoneBook
ON ancestor.name = phoneBook.organization
但是当我在mariadb中用相同的查询返回62行时,查询结果只返回1行(当然是在更改之后?值)返回正确。
这里是我的php垃圾场
object(mysqli_stmt)#75 (10) {
["affected_rows"]=>
int(62)
["insert_id"]=>
int(0)
["num_rows"]=>
int(62)
["param_count"]=>
int(1)
["field_count"]=>
int(1)
["errno"]=>
int(0)
["error"]=>
string(0) ""
["error_list"]=>
array(0) {
}
["sqlstate"]=>
string(5) "00000"
["id"]=>
int(29)
}
我试着去拿结果还是一样的。有人吗?
暂无答案!
目前还没有任何答案,快来回答吧!