zoukankan      html  css  js  c++  java
  • 数据库

    列标签

    select id,name from student;

    select id as '学号',name as '姓名' from student;(只是修改结果)

    排序

    select * from student where sex='1'

    order by sno asc,sname desc

    ps:ASC正序排序;DESC逆序排序

    IN、LIKE、IS NULL

    select * from student 

    where id IN('2020001','2020002','2020003')

    where id NOT IN('2020001','2020002','2020003')

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

    select * from student 

    where phone IS NULL

    select * from student 

    where phone IS NOT NULL

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

    select * from student where sname LIKE '张%'

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

    ps:‘%’是通配符

    常用函数

    selece * from student where year(birthday)>=1980

    and year(birthday)<1990

    注:查询90后的信息

    select max(id) from student

    表的关联

    SELECT stu.sname,stu.sage,stu.sno,sc.sno,sc.score
    FROM student stu,score sc  //起别名
    WHERE stu.sno=sc.sno  

  • 相关阅读:
    Grakn Forces 2020 I. Bitwise Magic
    October Challenge 2020 Division 1
    杂题
    杂题
    杂题
    hdu 6868
    Codeforces Round #673 (Div. 1)
    杂题
    2019 ICPC World Finals K
    【CSP2019】括号树 题解(递推+链表)
  • 原文地址:https://www.cnblogs.com/iamAngelo/p/12890634.html
Copyright © 2011-2022 走看看