gpt4 book ai didi

php - 根据时间戳连接表

转载 作者:行者123 更新时间:2023-11-29 14:37:21 25 4
gpt4 key购买 nike

friend 们大家好,我正在开发一个项目并制作一个通知系统。

为此我需要加入几张 table 。这样我就可以根据通知表的时间戳获取数据。

通知表

notification table

这里的类型是通知的类型。所以我想按时间戳排序它

类型墙柱 table 是

type wall post table is

键入墙评论表是

type wall comment table is

最后获取所有其他表中id的名称的user表是

用户表

user table

实在无法加入这些。任何人都可以帮忙吗......

最佳答案

我看到 user_id 是所有表中的公共(public)属性,因此您可以根据此属性连接表。

然后可以选择时间戳对应的表

Select * FROM notification_table INNER JOIN comment_table ON 
notification_table.user_d = comment_table.uid_fk INNER JOIN wallpost_table
ON comment_table.uid_fk == wallpost_table.uid_fk INNER JOIN user_table ON
wallpost_table.uid == user_table.uid

关于php - 根据时间戳连接表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8772213/

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