MySQL5.7中英对照文档_用户变量 User-Defined Variables

You can store a value in a user-defined variable in one statement and refer to it later in another statement. This enables you to pass values from one statement to another.
可以先在一个语句中保存用户变量的值,然后再另一个语句中引用它。这样可以将值从一个语句传递到另一个语句。

User variables are written as @var_name, where the variable name var_name consists of alphanumeric characters, ., _, and $. A user variable name can contain other characters if you quote it as a string or identifier (for example, @'my-var', @"my-var", or @`my-var`).
用户变量的形式是 @var_name,其中变量名var_name可以由当前字符集的文字数字(alphanumeric)字符、‘.’、‘_’和‘$’组成。 把当变量名当作字符串或标识符引用的时候,变量名也可以包含其它的字符(比如@'my-var', @"my-var", @`my-var`

User-defined variables are session specific. A user variable defined by one client cannot be seen or used by other clients. (Exception: A user with access to the Performance Schema user_variables_by_thread table can see all user variables for all sessions.) All variables for a given client session are automatically freed when that client exits.
用户变量仅在当前会话中生效。当前会话中的用户变量不能被其它会话访问(例外情况:访问Performance Schema库中user_variables_by_thread 表是)。当会话关闭后,用户变量就会失效。

User variable names are not case-sensitive. Names have a maximum length of 64 characters.
用户变量名对大小写不敏感,最长不超过64字符

One way to set a user-defined variable is by issuing a SET statement:
设置用户变量的一个途径是通过SET语句:

SET @var_name = expr [, @var_name = expr] ...

For SET, either = or := can be used as the assignment operator.
当用SET语句设置用户变量的时候,可以使用“=”或者“:=”操作符
You can also assign a value to a user variable in statements other than SET. In this case, the assignment operator must be := and not = because the latter is treated as the comparison operator = in non-SET statements:
也可以不用SET语句来设置用户变量,在这张情况下,必须使用“=”操作符

mysql> SET @t1=1, @t2&
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
下面是我 运行终端代码后的返回,请帮我解释下:shenhaibo@bogon webAssembly % emcc add.c -s WASM=1 -o add.wasm wasm-ld: error: /opt/homebrew/Cellar/emscripten/3.1.40/libexec/cache/sysroot/lib/wasm32-emscripten/libstandalonewasm-nocatch.a(__main_void.o): undefined symbol: main emcc: error: '/opt/homebrew/Cellar/emscripten/3.1.40/libexec/llvm/bin/wasm-ld -o add.wasm /var/folders/hd/zkctfvz128366gcjfw9pgslr0000gn/T/emscripten_temp_0gmz58hs/add_0.o -L/opt/homebrew/Cellar/emscripten/3.1.40/libexec/cache/sysroot/lib/wasm32-emscripten /opt/homebrew/Cellar/emscripten/3.1.40/libexec/cache/sysroot/lib/wasm32-emscripten/crt1.o -lGL -lal -lhtml5 -lstandalonewasm-nocatch -lstubs-debug -lc-debug -ldlmalloc -lcompiler_rt -lc++-noexcept -lc++abi-debug-noexcept -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr /var/folders/hd/zkctfvz128366gcjfw9pgslr0000gn/T/tmp6m8wb6r0libemscripten_js_symbols.so --strip-debug --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export=emscripten_stack_get_end --export=emscripten_stack_get_free --export=emscripten_stack_get_base --export=emscripten_stack_get_current --export=emscripten_stack_init --export=stackSave --export=stackRestore --export=stackAlloc --export=__errno_location --export-table -z stack-size=65536 --initial-memory=16777216 --max-memory=16777216 --stack-first' failed (returned 1) shenhaibo@bogon webAssembly %
06-07

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值