zoukankan      html  css  js  c++  java
  • 简单的查询

    1. 查询全部的行和列。

    Select * from 表名

    1. 查询部分的行和列。

    Select 列名1,列名2….. from 表名 where 条件。

    1. 在查询中使用列名的别名。

    ① 使用AS 字句来改变结果中列的名种。

    Select user as 用户名 from 表名

    ② 使用=’来改变结果中列的名种。

    Select user=’用户名’ from 表名

    ③ 使用’空格’来改变结果中列的名种。

    Select user 用户名 from 表名

    1. is null 和 ‘’ 的不同之处。

    is null 原始没有录入的数据,从未录过的数据

    ‘’录入过数据被删除是有数据的

    1. 查询返回限制的行数。

    TOP 关键字

    ①  select top 个数 列名(或*from 表名

    TOP 百分比数 percent

    ②  select top 百分比数 percent 列名(或*from 表名。

    1. 排序查询

    order by 排序

    asc:升序

    desc:降序

    select *from 表名(可以加whereorder by (升序还是降序)

    列:select user from book where name=‘忠民’)order by user(这里的user是你要排序的列名) asc

  • 相关阅读:
    v-date
    文字在图片上
    v-生命周期
    彭博接口分类
    如何指定vim 的查找是从上往下还是从下往上[z]
    查看linux版本
    git web找不到new project解决方法
    比特币运行原理[z]
    [Z]haproxy+keepalived高可用群集
    blockchain good article
  • 原文地址:https://www.cnblogs.com/xiaowie/p/8675053.html
Copyright © 2011-2022 走看看