Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options answers only user 1876
0
votes
GROUP BY Name HAVING COUNT(*) >= 2 You may need to do something like this: WHERE ... AND ( SELECT COUNT(*) FROM tbl WHERE Name = ... GROUP BY Name HAVI …
answered Feb 3 '16 by Rick James
1
vote
in another table, then this might be optimal: Table `nums` contains the `n` values. ALTER TABLE tbl ADD INDEX(id); -- if it does not already exist. SELECT ! EXISTS ( SELECT * FROM nums LEFT JOIN tbl …
answered Jul 5 '18 by Rick James
1
vote
Not a fair test. Your example is about as close as you can get between using JOIN to using EXISTS. Also, it probably gave a different result -- What if there are 2 Johns? The JOIN would count both … ; the EXISTS would count only once. EXISTS is a "semi-join". It is better than JOIN in cases where it can stop short of scanning for all rows that match. Instead, it stops with the first match. If …
answered Nov 29 '18 by Rick James