4

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!

Community
  • 1
  • 1
alexn
  • 57,867
  • 14
  • 111
  • 145
  • It would be nice if you added your trick to "Hidden Features of" question. It is seen much often and "ORDER BY FIELD" is nice feature. – LukLed Jun 15 '10 at 18:55
  • +1: Not for question but for this `ORDER BY FIELD` answer. I came to this questions searching for custom ordering :) – shamittomar Sep 02 '10 at 06:53

2 Answers2

2

Use EXPLAIN to profile the query execution plan

Srikar Doddi
  • 15,499
  • 15
  • 65
  • 106
1

Want to export a table?

Use SHOW CREATE TABLE customer to generate a create query.

alexn
  • 57,867
  • 14
  • 111
  • 145