Every now and then I see something like this: select u.* from users u where 0 = (select count(*) from addresses a where a.user_id = u.id); and it kinda pains me. So figured, I'll write about what is the problem with it, and how to avoid such constructs. Lets consider what went through someones mind … Continue reading "SQL best practices – don’t compare count(*) with 0"| select * from depesz;
If you need to test for a file’s existence, content size, and whether it was recently modified, the ‘find‘ utility can provide this functionality in a single call. One scenario for this usage might be the cached results from a remote service call (database, REST service, etc). If fetching these results was a relatively costly ... Bash: testing if a file exists, has content, and is recently modified| Fabian Lee : Software Engineer
Shell script snippets to check if you have an executable or binary| A Scripter's Notes
We check execution plans and benchmark results to see if using a LIMIT clause is useful when checking for existence of N values in SQL| Java, SQL and jOOQ.