• MySql-Mysql技术内幕~SQL编程学习笔记(N)


    1、_rowid

      类似Oracle的rowid

    mysql> select _rowid rowid,t.* from city t limit 10;
    +-------+----+----------------+-------------+---------------+------------+
    | rowid | ID | Name           | CountryCode | District      | Population |
    +-------+----+----------------+-------------+---------------+------------+
    |     1 |  1 | Kabul          | AFG         | Kabol         |    1780000 |
    |     2 |  2 | Qandahar       | AFG         | Qandahar      |     237500 |
    |     3 |  3 | Herat          | AFG         | Herat         |     186800 |
    |     4 |  4 | Mazar-e-Sharif | AFG         | Balkh         |     127800 |
    |     5 |  5 | Amsterdam      | NLD         | Noord-Holland |     731200 |
    |     6 |  6 | Rotterdam      | NLD         | Zuid-Holland  |     593321 |
    |     7 |  7 | Haag           | NLD         | Zuid-Holland  |     440900 |
    |     8 |  8 | Utrecht        | NLD         | Utrecht       |     234323 |
    |     9 |  9 | Eindhoven      | NLD         | Noord-Brabant |     201843 |
    |    10 | 10 | Tilburg        | NLD         | Noord-Brabant |     193238 |
    +-------+----+----------------+-------------+---------------+------------+
    rows in set (0.00 sec)
    
    mysql>

     2、查看表结构

    mysql> show create table tG;
    *************************** 1. row ***************************
           Table: t
    Create Table: CREATE TABLE `t` (
      `a` int(10) unsigned DEFAULT NULL,
      `b` int(10) unsigned DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8
    1 row in set (0.00 sec)
    
    ERROR:
    No query specified
    
    mysql> desc t;
    +-------+------------------+------+-----+---------+-------+
    | Field | Type             | Null | Key | Default | Extra |
    +-------+------------------+------+-----+---------+-------+
    | a     | int(10) unsigned | YES  |     | NULL    |       |
    | b     | int(10) unsigned | YES  |     | NULL    |       |
    +-------+------------------+------+-----+---------+-------+
    2 rows in set (0.00 sec)
    
    mysql>

     3、hex函数

     4、SQL_MODE:SQL模式

    5、MySQL中的函数

      1》cast:强制转换

      2》

  • 相关阅读:
    codevs1288 埃及分数
    codevs1792 分解质因数
    dp
    JAVA大数贪心
    求最长不重叠子串
    初识后缀数组
    dp
    两数相除,判断小数位是否有限位
    构造二分图匹配
    建立多个树状数组
  • 原文地址:https://www.cnblogs.com/ZeroMZ/p/11435632.html
Copyright © 2020-2023  润新知