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

  • 相关阅读:
    awk 使用shell 变量
    设计模式之 外观(门面)模式 Facade
    设计模式之 抽象工厂模式
    python 第一课
    Visual Basic 图片连接地址添加
    smarty 不同模板 缓存时间
    PHP 传参过滤
    Nginx 0.7.x + PHP 5.2.10(FastCGI)搭建支持高并发量的Web服务器
    linux vi 编辑命令
    PHP 命令模式 执行文件 并传递参数
  • 原文地址:https://www.cnblogs.com/3532gll/p/9649237.html
Copyright © 2011-2022 走看看