gpt4 book ai didi

mysql - 如何计算 SQL 中选定的行数

转载 作者:行者123 更新时间:2023-11-29 18:05:06 26 4
gpt4 key购买 nike

我想计算从查询中选择了多少行以及选定的数据。

SELECT `student`.`student id` AS ID,
`student unit enrolment`.`session`,
`student unit enrolment`.`unit code`,
`units`.`unit name`,
`workshops`.`campus`,
`workshops`.`location`,
CONCAT (
`teachers`.`first name`,
" ",
`teachers`.`last name`
) AS Tutor
FROM `student`,
`student unit enrolment`,
`units`,
`workshops`,
`teachers`
WHERE `student`.`student id` = `student unit enrolment`.`student id`
AND `student unit enrolment`.`unit code` = `units`.`unit id`
AND `student unit enrolment`.`unit code` = `workshops`.`unit code`
AND `workshops`.`teacher id` = `teachers`.`staff id`;

最佳答案

试试这个:

$result = mysql_query(YOUR_QUERY_HERE);
mysql_num_rows($result);

关于mysql - 如何计算 SQL 中选定的行数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47945042/

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