Get the App
SLTechnology News&Howtos  ›  Database  › 

How to understand the virtual column of mysql 5.7rowid

Shulou Source: shulou.com Published: 2022-05-31 15:43:40 09月30日 Update

How to understand the virtual column of mysql 5.7A _ rowid. For this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

Check the official material 13 SQL Statement Syntax13.1 Data Definition Statements13.1.14 CREATE INDEX Syntax test examples

Create a test table and insert data

Mysql > create table t_rowid (an int,b int,key (a)); Query OK, 0 rows affected (0.03 sec) mysql > insert into t_rowid select 1 OK 1 row affected (0.00 sec) Records: 1 Duplicates: 0 Warnings: 0mysql > insert into t_rowid select 2 * * query OK, 1 row affected (0.00 sec) Records: 1 Duplicates: 0 Warnings: 0

Show _ rowid

Mysql > select _ rowid from tweets rows in set + | _ rowid | +-+ | 1 | | 2 | +-+ 2 rows in set (0.00 sec) mysql > select _ ROWID from tweets rows in set + | _ ROWID | +-+ | 1 | 2 | +-+ 2 sec)

Show _ rowid and some columns

Mysql > select _ rowid,a from tactile rowidths-1 | 1 | 1 | 2 | 2 | +-+ 2 rows in set (0.00 sec)

Show _ rowid and all columns

Mysql > select _ rowid,a,b from tactile rowidths + | _ rowid | a | b | +-+-- +-+ | 1 | 1 | 1 | 2 | 2 | +-+-- + 2 rows in set (0.00 sec)

Cannot display _ rowid and *

Mysql > select _ rowid,* from tweets widgets and error 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near'* from tweets widgets'at line 1mysql >

_ rowid does not apply to the following scenarios:

The data type of a primary key column or a normal column is not a numeric type

The primary key is the federated primary key

The only column is not empty

This is the answer to the question about how to understand mysql 5.7 _ rowid false list. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

Tags: Questions data more types help tests answers easy ordinary uncomfortable easy content scenarios official guys partners numbers methods right and wrong knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia OPPO Reno Xiaomi Shulou Tech Info MySQL