What the best way to work around this? I have the same SELECT statement but there are different criteria depending on the IF check. Well, if you happen to be using Sql Server you can do that sort of ...
Read this SQL tutorial to learn when to use SELECT, JOIN, subselects and UNION to access multiple tables with a single statement. It’s sometimes difficult to know which SQL syntax to use when ...
Don't be afraid of using your chosen database's command-line client. I might as well say this up front: I don't like using GUI (aka non-command-line or graphical) tools with my databases. This is ...