Welcome Guest, Not a member yet? Register   Sign In
SQL help - can this be done with one query?
#6

[eluser]Sarfaraz Momin[/eluser]
Hey Grant,
I donno if the following would help you much but I had a similar situation and I found a way to get pass it. The query is as follows

MarterLinks = tags
CountLinks = item_tag

Code:
select masterLinks.masterLinkID, masterLinks.postUser,".
"masterLinks.postPic,masterLinks.postLink,".
"masterLinks.postID,masterLinks.postText,".
"masterLinks.postDate,masterLinks.postContent,masterLinks.postTitle,".
"substring(max(concat(countLinks.published,'|',countLinksID)),21) as countLinksID, ".
"count(countLinksID) as numCountLinks from masterLinks left join countLinks ".
"using(masterLinkID) group by masterLinkID order by masterLinkID;

You can add a simple userid in the where clause to get result based on users.

Have a good day !!!


Messages In This Thread
SQL help - can this be done with one query? - by El Forum - 01-07-2009, 11:27 PM
SQL help - can this be done with one query? - by El Forum - 01-08-2009, 12:01 AM
SQL help - can this be done with one query? - by El Forum - 01-08-2009, 12:29 AM
SQL help - can this be done with one query? - by El Forum - 01-08-2009, 06:11 AM
SQL help - can this be done with one query? - by El Forum - 01-08-2009, 03:41 PM
SQL help - can this be done with one query? - by El Forum - 01-08-2009, 06:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB