2,187
edits
m (→SELECT Rows: Added "JOIN") |
(→SELECT Rows: Added ORDER BY) |
||
Line 103: | Line 103: | ||
'''AS''' | '''AS''' | ||
<source lang="mysql"> SELECT INET_NTOA(ip) AS ip, name FROM hosts; </source> | <source lang="mysql"> SELECT INET_NTOA(ip) AS ip, name FROM hosts; </source> | ||
'''ORDER BY''' | |||
<source lang="mysql"> SELECT INET_NTOA(ip) AS ip, name FROM hosts ORDER BY ip; </source> | |||
NULL's can be a bit of pain as they tend to end up at the top, to force then to the bottom insert an additional <code>ISNULL(column)</code> for column your sorting by which has NULL values... | |||
<source lang="mysql"> SELECT INET_NTOA(ip) AS ip, name FROM hosts ORDER BY ISNULL(ip), ip; </source> | |||
=== JOIN === | === JOIN === |