MySQL重要查询
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL重要查询相关的知识,希望对你有一定的参考价值。
//Connection //Creat DB //Create table $sql = "CREATE TABLE Persons ( id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT, FirstName varchar(15) NOT NULL, LastName varchar(15) NOT NULL, Age int, PRIMARY KEY (id) )"; //Insert row in table //Update row //Delete row //Select one row echo $row['LastName']; //Select more rows echo $row['LastName']; } //Select more rows order by Age discending from the rows from 0 to 10 $result = mysql_query("SELECT * FROM Persons WHERE FirstName='Peter' ORDER BY Age DESC LIMIT 0,10") or die(mysql_error()); echo $row['LastName']; }
以上是关于MySQL重要查询的主要内容,如果未能解决你的问题,请参考以下文章
MySql-表的概念DQL查询语句条件查询模糊查询分组函数单行处理函数连接查询笛卡尔积现象内外自连接子查询重要关键字建表增删改查