是否可以进行如下查询:
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
Run Code Online (Sandbox Code Playgroud)
我已经尝试了但是我将@threadID作为NULL返回,因此postDate也为NULL.
如何让变量@threadIDvar填充返回的threadID?
| 归档时间: |
|
| 查看次数: |
6309 次 |
| 最近记录: |