zoukankan      html  css  js  c++  java
  • SQL 高级教程

    注:本篇博客与W3CSCHOOL搭配,目的是在自己学习sql时,进行总结。

    1.sql top--------select top 3 * from persons// 从persons表中选前三个

                 ---------select  50 percent  * from persons  //从表中选择前一半

     2.like ,not like----------  select * from persons where city like 'N%'          //从persons中选择那些  city 名字以N开头的 符合条件的列

                           ----------- select * from persons where city like '%N%'         //从persons中选择那些  city  名字 N在中间的的 符合条件的列

                           ----------- select * from persons where city not like '%N%'         //从persons中选择那些  city  名字没有N在中间的的 符合条件的列

    3.通配符         ------------ select *from persons where city like '_slo'                 //从persons中选择那些  city  名字长的类似_slo 的符合条件的列

                           ----------- select * from persons where city like '[sld]poo'          ////从persons中选择那些  city  名字是 spoo 或者 lpoo 或者  dpoo 的列

                             ----------- select * from persons where city like '[^rty]poo'          ////从persons中选择那些  city  名字不是 rpoo 或者 tpoo 或者  ypoo 的列

    4.  in              ----------- select * from persons where city in ('newyork','beijing')   //从persons中选择那些  city  名字是 newyork 或者 beijing 的列

  • 相关阅读:
    假期12
    假期11
    第十六章 IP子网的划分
    第十五章 链路聚合基本原理及其基本配置
    第十四章 交换机端口技术
    第十七章 nginx动静分离和rewrite重写
    第十六章 四层负载均衡
    第十五章 nginx七层负载均衡
    第十四章 nginx代理配置
    每日日报
  • 原文地址:https://www.cnblogs.com/3532gll/p/9649237.html
Copyright © 2011-2022 走看看