我有一个数据库表。
在此表中,我有列名 User_Id。
我想按 3 个级别对结果进行排序:
- 第一个结果应该是特定用户的 id 2+3。按某些列排序。
是否可以进行如下查询:
Select * From User
Order By User_Id = 1223, Start_Date, Last_Name;
更新:
这是我的查询:
SELECT Events.Event_Id, Events.Name as Event_Name, Events.Place, Events.Start_Time, Events.End_Time, getEventInvitedUsers(Events.Event_Id) as Invited_Users, getEventAttendingUsers(Events.Event_Id) as Attending_Users,
Users.Facebook_Id, Users.Name as User_Name, Users_In_Events.Is_Attending as Is_Attending
FROM Users_In_Events
Left Join Events
On Users_In_Events.Event_Id = Events.Event_Id
Left Join Users
On Events.Facebook_Id = Users.Facebook_Id
WHERE
Users_In_Events.Facebook_Id = 613714903
And
(Events.Start_Time > now()
Or
(Events.Start_Time > now() And Events.End_Time < now()))
Order By Events.Facebook_Id= 613714903, Users_In_Events.Is_Attending, Events.Start_Time;
该查询从事件表中返回所有类型的事件。
我想知道是否可以按照我在上面的代码中编写的那样对结果进行排序Events.Facebook_Id= 613714903