zoukankan      html  css  js  c++  java
  • SQL基本操作

    https://www.sqlteaching.com   SQL练习网站

    SELECT * FROM friends_of_pickles  返回所有行和列

    SELECT name,gender FROM friends_of_pickles  返回name,gender的所有行和列

    SELECT * FROM friends_of_pickles WHERE species = 'dog';  返回 species为dog的所有行和列

    SELECT * FROM friends_of_pickles WHERE height_cm < 45; 返回height_cm小于45的所有行和列

    SELECT * FROM friends_of_pickles WHERE height_cm >= 45; 返回height_cm大于等于45的所有行和列

    SELECT * FROM friends_of_pickles WHERE height_cm >= 45 AND species= 'human'; 返回height_cm大于等于45并且species=human的所有行和列

    SELECT * FROM friends_of_pickles WHERE height_cm >= 45 OR species= 'human';返回height_cm大于等于45或者species=human的所有行和列

    SELECT * FROM friends_of_pickles WHERE  species IN ('human','dog'); 返回species在human,dog中的所有行和列

    SELECT DISTINCT gender FROM friends_of_pickles WHERE  species IN ('human','dog'); 返回species在human,dog中的物种的gender并去重

    SELECT * FROM friends_of_pickles ORDER BY name 返回按name的升序排序所有的行和列

    SELECT * FROM friends_of_pickles ORDER BY name DESC; 返回按name的降序排序所有的行和列

    SELECT * FROM friends_of_pickles ORDER BY name DESC LIMIT 2;  返回按name的降序排序前两行的行和列

    SELECT COUNT(*) FROM friends_of_pickles;  返回所有的行数

  • 相关阅读:
    linux下解压命令详解
    SSL简介及工作原理
    在CentOS中安装gcc配置c语言开发环境(转)
    JTable表格(隐藏表头)(转)
    一个云平台开源项目Eucalyptus
    「CF645E」 Intellectual Inquiry
    「CERC2017」Donut Drone
    洛谷P3943 星空
    「CSPS 2019」格雷码
    洛谷P3941 入阵曲
  • 原文地址:https://www.cnblogs.com/louzi/p/9956665.html
Copyright © 2011-2022 走看看