SELECT PostTags.PostId, Posts.Id, Posts.Tags, COUNT(*) FR...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Gardening and Landscaping

Q&A for gardeners and landscapers

--mēģināju pielikt Tagus no Posts tabulas, bet nav korekti
SELECT PostTags.PostId, Posts.Id, Posts.Tags, COUNT(*)
FROM PostTags, Posts
WHERE PostTags.PostId=Posts.Id
GROUP BY PostTags.PostId, Posts.Id, Posts.Tags
HAVING COUNT(*)=2
ORDER BY PostTags.PostId ASC


--SELECT PostTags.PostId, PostTags.TagId, Tags.Id, Tags.TagName, Posts.Tags
--FROM PostTags, Tags, Posts
--WHERE PostTags.TagId=Tags.Id AND PostTags.PostId=Posts.Id
--AND PostId IN (14, 66)

--SELECT PostId, COUNT(*)
--FROM PostTags
--GROUP BY PostId
--HAVING COUNT(*)=2
--ORDER BY PostId ASC

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results