![]() |
Export threads from a single user / Query modification
Hi all,
I need a bit support. A good friend of mine died and he actively posted in my forum and started several threads. So I would like to export all threads my friend started including the first post he wrote. I'd like to use this as a kind of memorial for all of his friends. The following query does a good job to get all of his postings, but I only want to export the threads including the first post. Could anyone help me how to modify the query? Code:
SELECT post.postid, post.threadid, thread.title, post.username, FROM_UNIXTIME(post.dateline) as date, post.pagetext from post, thread WHERE post.threadid = thread.threadid AND post.username = 'XXXXXXXXXX' ORDER BY date; Michael |
Try changing:
Code:
post.threadid = thread.threadid Code:
post.postid = thread.firstpostid |
Thanks so much, Mark. Thanks so much.
--------------- Added [DATE]1484640652[/DATE] at [TIME]1484640652[/TIME] --------------- Mark, I hope it's okay that I ask another question. How do I need to modify the query if I want to extract all threads my friend started including all other postings(I mean replies) of theses threads? So I export the complete thread? Thanks so much. Michael |
I think would be easier if you do another query to only get the secondary posts.
If you agree with me you can try something like this: 1 - Store threadid and firstpostid into variables. 2 - Query. Code:
SELECT * FROM post WHERE threadid = YourFriendThreadID and postid <> FirstPostID |
Quote:
Code:
SELECT post.* FROM post AS post WHERE post.threadid IN (SELECT thread.threadid FROM thread AS thread WHERE thread.postusername = 'XXXXX') |
All times are GMT. The time now is 06:32 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|