MaysamSh

Untitled

Apr 1st, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.33 KB | None | 0 0
  1. SELECT * FROM ( SELECT TOP 2 * FROM [sosco].[dbo].[contents]
  2. WHERE Visible=1 AND CategoryID=13 AND ContentType=2
  3. UNION
  4. SELECT TOP 2 * FROM [sosco].[dbo].[contents]
  5. WHERE Visible=1 AND CategoryID=13 AND ContentType=1
  6. UNION SELECT * FROM [sosco].[dbo].[contents] WHERE ID=0)
  7. a WHERE a.ID NOT IN(0) ORDER BY a.CreationDate DESC
Advertisement
Add Comment
Please, Sign In to add comment