How do I use ROWCOUNT and TOP to limit the query results on Stack Exchange Data Explorer (SEDE)?
For example, fetch me 10 posts tagged JavaScript which have fiddles in them.
Reason - Timeout expired
Meta Stack Exchange is a question and answer site for meta-discussion of the Stack Exchange family of Q&A websites. It only takes a minute to sign up.
Sign up to join this communityHow do I use ROWCOUNT and TOP to limit the query results on Stack Exchange Data Explorer (SEDE)?
For example, fetch me 10 posts tagged JavaScript which have fiddles in them.
Reason - Timeout expired
Not really sure how on topic this is but I understand how the timeout's on the Stack Exchange Data Explorer can be annoying. Apparently, a new server is in the offing, which might makes things better.
You're probably looking for PATINDEX
, a T-SQL function, which:
Returns the starting position of the first occurrence of a pattern in a specified expression, or zeros if the pattern is not found, on all valid text and character data types.
For instance
SELECT TOP 10 *
FROM posts
WHERE PATINDEX('%http://jsfiddle.net%', body) <> 0
and tags like '%javascript%'
The other option is CHARINDEX
; apparently (I have no idea) there's not much difference between them.