SQL Select符号||是什么意思是? [英] What does SQL Select symbol || mean?

查看:228
本文介绍了SQL Select符号||是什么意思是?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

||在SQL中做什么?

SELECT 'a' || ',' || 'b' AS letter

推荐答案

||表示字符串连接.不幸的是,字符串连接不能完全移植到所有SQL方言中:

|| represents string concatenation. Unfortunately, string concatenation is not completely portable across all sql dialects:

  • ansi sql:||(中缀运算符)
  • mysql:concat(vararg函数). 警告:||表示逻辑或"(这是可配置的,但是要感谢 @hvd 指出)
  • >
  • oracle:||(中缀运算符),concat(警告:仅Arity 2的功能!)
  • postgres:||(中缀运算符)
  • sql server:+(中缀运算符),concat(vararg函数)
  • sqlite:||(中缀运算符)
  • ansi sql: || (infix operator)
  • mysql: concat ( vararg function ). caution: || means 'logical or' (It's configurable, however; thanks to @hvd for pointing that out)
  • oracle: || (infix operator), concat ( caution: function of arity 2 only ! )
  • postgres: || (infix operator)
  • sql server: + (infix operator), concat ( vararg function )
  • sqlite: || (infix operator)

希望混乱已经完成...

hopefully the confusion is complete ...

这篇关于SQL Select符号||是什么意思是?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆