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 的列

  • 相关阅读:
    透明度问题解决方案
    不得不去奋斗的原因
    未来的你肯定会感谢现在努力的你
    前端学习参考
    js仿京东轮播图效果
    hyper容器网络相关源码分析
    利用setns()将进程加入一个新的network namespace
    frakti && RunPodSandbox 源码分析
    Makefile 编写 tips
    《In Search of an Understandable Consensus Algorithm》翻译
  • 原文地址:https://www.cnblogs.com/3532gll/p/9649237.html
Copyright © 2011-2022 走看看