i think should work:
select parent.commentid commentid, parent.userid userid, parent.message message, parent.date date, null parentcommentid #parentcomment parent userid = 'user1' union select child.c_commentid commentid, child.c_userid userid, child.c_message message, child.c_date date, child.c_parentcommentid parentcommentid #childcomment child child.c_userid = 'user1'
here's sql fiddle : http://sqlfiddle.com/#!9/3bb46/2
hope helps!!!
Comments
Post a Comment