Wouldn’t it be nice if you could get expert advice on your SQL
queries to find problems in them, the same way that programmers
can use lint-check tools to warn about bugs in their C?
if ( execute = 1 ) {
launch_missile();
}
Such a simple mistake, but it’s the kind of thing that James Bond
movies are made of, isn’t it? Well, a lot of SQL queries have
similar bugs, and thanks to Miguel Trias, now there’s a tool to
help you find them. This is the second addition to our online suite of
tools for MySQL users. You paste a query, it tells you what’s
wrong with it. Simple as that.
Find the bug in this query:
select * from t1
left join t2 using(id)
where t2.created_date < 2012-02-15;
Do you see it? Congratulations! I've analyzed that query with the
tool, and shared the results with you. …