美文网首页
SQL语句用法大全

SQL语句用法大全

作者: 冰柠檬_705e | 来源:发表于2019-04-11 11:13 被阅读0次

    1.查询语句:

    select  “栏目名” from “表名”

    select * from A

    去重distinct语句:

    select distinct name from A

    条件查询:Where and or

    select * from A Where score >60 and score<80

    查询相同字段不同值:in(不连续)

    select *  from A Where name in(“Leo”,“Xua”)

    between(连续)

    select * from A Where score between “70” and “90”

    模糊查询:Like

    select * from A Where name like “王%”

    “A_Z”(ABZ),“A%”,“%A”,“%A%”;

    排序:order by (des,asc)默认asc;

    select * from A order by age desc

    函数:avg,count,max,min,sum

    select 函数(栏目)  from A

    相关文章

      网友评论

          本文标题:SQL语句用法大全

          本文链接:https://www.haomeiwen.com/subject/tpzziqtx.html