Created
March 1, 2011 12:02
-
-
Save TowardsDeath/849035 to your computer and use it in GitHub Desktop.
Queries generated by LLBLGen from gist 849013
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
DISTINCT TOP 1 COUNT(*) AS [LPAV_] | |
FROM | |
( | |
SELECT | |
[LPLA_1].[Id] | |
FROM | |
[Tag] [LPLA_1] | |
WHERE | |
[LPLA_1].[Title] = 'title1' | |
OR [LPLA_1].[Title] = 'title2' | |
) [LPA_L1] | |
SELECT | |
[LPA_L2].[Id] | |
FROM | |
( | |
SELECT | |
[LPA_L3].[ArticleId] AS [key], | |
[LPA_L3].[LPAV_] AS [count], | |
[LPA_L3].[ArticleId] | |
FROM | |
( | |
SELECT | |
[LPLA_1].[ArticleId], | |
COUNT(*) AS [LPAV_] | |
FROM | |
[ArticleTag] [LPLA_1] | |
WHERE | |
EXISTS | |
( | |
SELECT | |
[LPA_L4].[Id] | |
FROM | |
( | |
SELECT | |
[LPLA_2].[Id] | |
FROM | |
[Tag] [LPLA_2] | |
WHERE | |
[LPLA_2].[Title] = 'title1' | |
OR [LPLA_2].[Title] = 'title2' | |
) [LPA_L4] | |
WHERE | |
[LPA_L4].[Id] = [LPLA_1].[TagId] | |
) | |
GROUP BY | |
[LPLA_1].[ArticleId] | |
) [LPA_L3] | |
) [LPA_L1] | |
INNER JOIN | |
[Article] [LPA_L2] ON [LPA_L1].[Key] = [LPA_L2].[Id] | |
WHERE | |
[LPA_L1].[count] = 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment