zoukankan      html  css  js  c++  java
  • mysql语句

    查询字段长度:
    SELECT MAX(LENGTH(pd)) FROM `table` where id=2;
    来检查当前表中字段的字符集设置。
    show full fields from tableName;

    1、字段使用别名:

    Select remark as r from ‘test’ 

     

    2Select * from ‘test’ where id in (1,2,4)

    3select * from ‘test’ where id=2

    4select * from ‘test’ where ‘uid’ like ‘%%’ 

    5select * from ‘test’ where id between 1 and 3

    6select * from ‘test’ id=1 and ‘remark’=’学生’

    -------------------------------------------------------------------------------------------

    7select * from ‘test’ group by ‘remark’

    8select * from ‘test’ order by ‘regdate’ desc   降序

     

    9、group by   ->order by   ->limit

    --------------------------------------------------------------------------------------------

    10、Select count(*) from ‘test’ where 1 

    11、Select MAX(id) from ‘test’

    12、Select MIN(id) from ‘test’

    13、select avg(年龄) as 平均年龄 from student group by 性别;

     

    14、Insert into test(‘id’,’uid’,’regdate’,’remark’) values (‘ ’,’PHP100’,now(),’工人’)

    15、Insert into test values(‘ ’,’PHP100’,now(),’工人’)

      

    16、update test set uid=’PHP300’ where id=6

     

    17delete from test where id=3

  • 相关阅读:
    动态规划>0/1背包问题 小强斋
    【C/C++和指针】auto_ptr智能指针
    WEBSHELL
    sql反模式分析1
    SQLServer之Compute/ComputeBy实现数据汇总
    链表算法大全
    【C++ Primer】自己动手编写函数 atoi(char *str)
    MySQL 5.5 的COMPRESSED INNODB 表
    【设计模式】加薪非要老总批 职责链模式
    【C和指针】const指针
  • 原文地址:https://www.cnblogs.com/c-961900940/p/4030062.html
Copyright © 2011-2022 走看看