JOIN
子句来关联两个表并查询数据。,,``sql,SELECT a.column1, b.column2,FROM table1 a,JOIN table2 b ON a.common_column = b.common_column;,
`,,这个查询将返回
table1 和
table2 中通过
common_column` 关联的数据。JOIN
子句来关联两个表并查询数据。,,``sql,SELECT a.column1, b.column2,FROM table1 a,JOIN table2 b ON a.common_column = b.common_column;,
`,,这个查询将返回
table1 和
table2 中通过
common_column` 关联的数据。php,$query = "SELECT * FROM users WHERE name LIKE '%John%'";,
``,,这段代码会查找名字中包含"John"的所有用户。LIKE
关键字配合通配符%
和_
来实现。Powered By Z-BlogPHP 1.7.3
Copyright Your WebSite.Some Rights Reserved.