SQL

来源:互联网 发布:淘宝二次认证不通过 编辑:程序博客网 时间:2024/05/16 11:47

DML:数据处理语言,insert,update,select,delete。

DDL:数据定义语言,create table,alter table。

DCL:数据控制语言,grant,revoke。

简单查询(select)

select now();

count();

distinct

limit :是从0开始计数的。SQL_CALC_FOUND_ROWS,FOUND_ROWS()

order by; desc倒叙;collate(临时改变用另一种方式进行排序)

条件判断

where

having

like %

如果where和having同时出现,MySQL将优先执行where子句,而having子句只能用来对select.......where......查询的结果做进一步筛选。HAVING的优点是

 

 

 

 

 

 

 创建数据库、数据表和索引

create database

create table

create index

alter table

drop table

drop database

show,information_schema

 SQL解决方案:

1、字符串

concat(),

substr(),

char_length()

length()

if(a,b,c)

replace()

locate()

convert

 

 

原创粉丝点击