按日期时间从2个不同的表中排序数据 [英] ordering data by datetime from 2 different tables

查看:107
本文介绍了按日期时间从2个不同的表中排序数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,所以,我试图做的事情对我来说很复杂,我试图用尽可能少的服务器使用量做到这一点...我想要做的是基本上做一个显示我的朋友的输出更新"但按时间顺序。

ok, so, what im trying to do is complicated for me, im trying to do this with as least amount of server usage as possible... what im trying to do is basically make an output that shows my "friends updates" but in time order.

展开 | 选择 | Wrap | 行号

推荐答案

将成员表加入更新表。


你是对的,一个联合查询就是答案。但是,你没有提供桌子结构,所以你把我们留在黑暗中。它看起来像这样:
You are correct, a joined query is the answer. However, you don''t provide the tables structures, so you leave us in the dark. It would look something like this:
展开 | 选择 | Wrap | 行号


抱歉,我没有留下更多信息,我希望能够做到我自己的大部分工作。但我没有多少运气,我会尝试提供更多信息......在myMembers表中我有一大堆表,只有一个我需要从哪里(friend_array)和更新表生病需要所有表格。 (id,user,name,datetime,type,profile_id,location_id,album_id,thread_id)


现在我认为是棘手的部分,就是在我的friends_array中;表,它列出了许多人,例如(4,2,7,12,8),这就是我的朋友列表看起来如何,我认为在左边的连接中它不会理解所有成员是一起运行的,只有用逗号分隔
sorry, i didnt leave more information, I was hoping to be able to do most of the work myself. but i havent had much luck, i will try to give more information... in the myMembers table i have a whole bunch of tables, only one i need from where is the ("friend_array") and from the updates table ill need all tables. ("id, user, name, datetime, type, profile_id, location_id, album_id, thread_id")

now what i think is the tricky part, is that in my "friends_array" table, it has many people listed, for example ("4,2,7,12,8") thats how my freinds list looks and i think in the left join its not going to understand all the members are run together and only seperated by commas


这篇关于按日期时间从2个不同的表中排序数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆