What are your most common SQL optimization that you used?
The two most important things in my experience are fewer joins and less queries. Other than those there's lots of DB specific stuff, COUNT(*) is relatively slow on PgSQL, subselects are dog slow on MySQL, etc.
The best optimisation I've ever had using SQL was to really understand what was needed to be done the data and REMOVE ton's of SQL from the query.
The fastest query is the query that does not have to be run.
REALLY THINK about what your doing to the data. Are you working row-by-row? (then use set based code).
Do you really need to join to all those tables?
Can two small (simple) queries do the job better and quicker than a single large query?
If you combine these two queries into a single query can it run faster?
Finally, PROFILE your queries (EXPLAIN PLAN or SQL PROFILER) and look at the "IO gets". Generally you want to reduce the number of GET's to a ratio something like 10 gets per output row.
The biggest optimizations i used recently where quite simple.
Keep as much of the business logic as close as possible to the sql server. Aka keep you business code on the same machine as the sql server. Let your business logic return as little as possible code back to the final client.
Keep your SQL query's as 'short as possible' like Frost said, use single update statements over multiple statements.
Only use transactions when you need them
Create temp tables for partial joins to speed up the joins (dont forget to index them)
Avoid the use of onboard functions like convertdate, stringreplace and such in your Views. If you can't make sure that the data is in a valid format use stored procedures which run reguallary to 'clean up' the data in your relevant tables.
this is nasty, but it saves the views time i.e. keeps the user happy... ^^
Index foreign keys!
Maybe this isn't a sql query syntax optimisation, but more a storage optimisation. But i see it re-occur all the time & its a pet peeve.