sql server - SQL Join Tables - 2nd newest entry to related main entry in other table -
After the abstract scenario, I have 2 tables, one contains "posts" and other "comments" if you use a new " Post ", a new" comment "type of" initial "type has been added whenever you add a real comment, then it becomes a type of post id and" picture "," text "," movie " Is ...
Now showing me the date of a table initial post and the first "real" comment Wanna may include that when the first note was taken not done until it's how long he wrote.
SELECT post.ID, post.Title, post.uthor, post.CreateDate, comment.Type, comment.Text, comment. Post from posts as post INNER post. ID = Join comment as a comment. Postid
This gives me the post information for the amount of comments I now just want to post the first "real" comment date standing next to the createDate (comment where. 'Initial')
How to do this, I do not know, can anyone help me in this matter? It is also possible to run on MS SQL 2000 ...
Thank you in advance ...
Try it:
SELECT post.ID, maximum (post. Tight), maximum (post author), minutes (post. Credited), minutes (commented on commented commented on commented Post comments as comments, postid, where to comment. Type! Type, type, type, type. Not. Type. Type. Type. Type. = "Early" group post.id
Comments
Post a Comment