sql - 如何在 oracle 中将 3 列添加为 1
问题描述
大家好,我尝试添加 3 列并将其显示为 1 列。当我尝试这个时,我得到一个错误,我使用 concat 并尝试了这个。
我在 oracle 中使用我用谷歌搜索它显示 concat 作为答案,但它确实有效
我试过这个,但它说
select CONCAT(hiredate, 'Stared', employeeName) AS test from employee;
ORA-00909: 参数数量无效
我想将这 3 列视为 1,因此它需要显示 Test 2010 年 5 月 15 日测试 Jon jones
解决方案
一种选择是使用||
连接运算符:
select hiredate ||' '|| 'Stared' ||' '|| employeeName
from some_table
推荐阅读
- node.js - 使用 node-postgres 查询的 Promise 总是返回 undefined
- c++ - 编译器是否允许围绕 `std::condition_variable::notify_one` 重新排序语句?
- javascript - if条件中的javascript井字游戏逻辑错误
- python - 在 Python 中使用 ctypes.CDLL 调用 ac 函数时,函数总是将 0 作为参数传递
- django - 我可以将搜索框添加到 Django 管理员添加页面吗?
- python - 无法在我的 Django 项目中安装简单 JWT
- c++builder - 如何在 C++ Builder 中为浮点数设置 DecimalSeparator
- python - Pandas groupby 根据条件创建新列
- java - Android 应用无法连接到 Socket.io 服务器
- python - 三个数据框的交叉连接