title: MySQL order by primary key
body: <p>Some SQL servers allow for a generic statement such as <code>ORDER BY PRIMARY KEY</code>.  I don't believe this works for MySQL, is there any such workaround that would allow for automated selects across multiple tables or does it require a lookup query to determine the primary key?</p>
  
  <p>The workaround I have been working on involves calling a <code>SHOW COLUMNS FROM</code> before running the query.  Is there a more efficient way of doing this?  Can MySQL determine the primary key of a table during the select process?</p>
  
  <p><strong>Update:</strong>  There is no official way of doing this in MySQL or SQL in general as Gordon pointed out.  SAP has custom functionality for it.  There are workarounds, such as working with <code>SHOW COLUMNS FROM table</code> or the <code>information_schema</code> as John pointed out.</p>