= Only when setting and updating does it have the same effect as :=, that is, assignment; otherwise it has the effect of equality. In view of this, when using variables to implement line numbers, you must use :=. := It not only has the function of assigning values when setting and updating, but also when selecting. The following is a comparison of the effects of = and = in select sql set @num = 0; SELECT @num := @num+1 AS rowno, nc as nickname from table_user; result sql set @num = 0; SELECT @num = @num+1 AS rowno, nc as nickname from table_user; result sql set @num = 0; SELECT @num = @num AS rowno, nc as nickname from table_user; result Reference: https://www.jb51.net/article/167218.htm Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. You may also be interested in:
|
<<: Use the Linux seq command to generate a sequence of numbers (recommended)
>>: js implements axios limit request queue
First, let me explain the application method. The...
This article example shares the specific code of ...
First, let's introduce several common operati...
1) Scope of application: readonly:input[type="...
Table of contents Preface 1. Application componen...
Table of contents Binding Class Binding inline st...
1. Download 2. Decompression 3. Add the path envi...
1. Install Docker First open the Linux environmen...
Background requirements: The ERP system needs to ...
Problem phenomenon: [root@localhost ~]# docker im...
A CSS layout and style question: how to balance h...
Since my local MySQL version is relatively low, I...
The main configuration file of Nginx is nginx.con...
This article example shares the specific code for...
This article example shares the specific code of ...