mysqli - Multiple ORDER BY from multiple Tables -
alright ive been struggling 1 far long, assistance grateful.
i have 2 tables:
table name: column names. (only showing relevant column names)
topics: topic_id, topic_cat, topic_stick replies: reply_id, reply_date, reply_topic
im trying (topic_id)'s = 1, in want sorted latest (reply_date), , having (topic_stick) @ top.
reply_topic = topic_id
i have been trying statement after statement no success: has been closest attempt not sort table wishes.
select topic_id topics, replies reply_topic = topic_id , topic_cat = 1 group topic_id order reply_date desc, topic_stick asc
select t.topic_id, t.topic_cat, t.topic_stick, r.reply_id, r.reply_date, r.reply_topic replies r inner join topics t on t.topic_id = r.reply_topic t.topic_cat = 1 group r.reply_topic order r.reply_date desc
Comments
Post a Comment