如何从两个表中按日期时间字段顺序从两个表中选择字段?
我的餐桌信息: 表“entry1”有字段“id”“title”“username”“date_post”和其他字段 表“entry2”具有字段“id”“title”“username”“date_post”以及其他
包含更多信息的字段: 1) 表“entry1”中的“id”与表“entry2”中的“id”不同 2)两个表中的字段“date_post”都是我想要的日期时间类型
:我想从两个表中选择“id”“title”“username”和“date_post” 并按语句中两个表中的“date_post”DESC 进行排序。
抱歉,我对 PHP 很陌生,而且我的英语不好。很难问。
my table info:
table 'entry1' have fields 'id' 'title' 'username' 'date_post' and other fields
table 'entry2' have fields 'id' 'title' 'username' 'date_post' ant other fields
with more info:
1) 'id' in table 'entry1' is not the same as 'id' in table 'entry2'
2) field 'date_post' from both table are type of datetime
what i want: I want to select 'id' 'title' 'username' and 'date_post' from both table
and order by 'date_post' DESC from both table in a statement.
Sorry all, I'm very new to PHP and my english is not good. It's very difficult to ask.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我的工作代码是:
My working code is:
假设两个表具有相同的列名和类型。试试这个。
Assume that both table have same identical column names and types. Try this.