= 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
Preface I recently made a fireworks animation, wh...
Table of contents background: need: Effect 1. Ide...
Preface Forgotten passwords are a problem we ofte...
Table of contents Code Optimization Using key in ...
Preface Share two methods to monitor whether an e...
Table of contents 1. Template 2. Generics 3. Gene...
Table of contents I. Overview 2. pt-archiver main...
This article shares the specific code of canvas t...
The following CSS class names starting with a num...
This article example shares the specific code of ...
The most important interactive design article in ...
Today I used docker to pull the image, but the sp...
Table of contents What is the listener property? ...
There is often a scenario where the image needs t...
When the above settings are used in IE8 and Chrome...