是否可以进行如下查询:
SELECT
@threadIDvar = `threads`.`id` AS `threadID`,
(SELECT `posts`.`timeDate` FROM `posts` WHERE `posts`.`threadID` = @threadIDvar) AS `postDate`
FROM `threads`
INNER JOIN `posts` ON `posts`.`threadID` = `threads`.`id`
WHERE `threads`.`boardID` = 1
我已经尝试了但是我将@threadID作为NULL返回,因此postDate也为NULL。
如何使用返回的threadID填充变量@threadIDvar?