views:

87

answers:

2
+4  Q: 

Mysql ninja tricks

Possible Duplicate:
Hidden Features of MySQL

Hi,

what are your mysql ninja tricks? What features are extra special?

I'm starting with ORDER BY FIELD which enables you to sort in a particular order, like this:

SELECT url FROM customer ORDER BY FIELD(customer.priority, 1, 2, 3, 0)

Features like this is hard to find in the mysql documentation.

Bring it!

+2  A: 

Use EXPLAIN to profile the query execution plan

CodeToGlory
Just to add to it -- this is an incredible tool to optimize a query
Kerry
How is `EXPLAIN` unique to MySQL?
Dolph
A: 

Want to export a table?

Use SHOW CREATE TABLE customer to generate a create query.

alexn