Difference between revisions of "MySQL"
Jump to navigation
Jump to search
m (→CREATE / ALTER Tables: Added an ALTER example) |
m (→SELECT Rows: Added "JOIN") |
||
Line 104: | Line 104: | ||
<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> | ||
=== JOIN === | |||
<source lang="mysql">SELECT make, model FROM table JOIN hosts ON table.id=hosts.id WHERE hosts.ip=INET_ATON('10.10.255.253');</source> | <source lang="mysql">SELECT make, model FROM table JOIN hosts ON table.id=hosts.id WHERE hosts.ip=INET_ATON('10.10.255.253');</source> | ||
Different types of join will yield differing results, depending how different rows match up see http://www.wellho.net/mouth/158_MySQL-LEFT-JOIN-and-RIGHT-JOIN-INNER-JOIN-and-OUTER-JOIN.html | |||
== Software Packages == | == Software Packages == | ||
[[Category:MySQL]] | [[Category:MySQL]] |