- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
几天前我问了一个question关于我的问题,我被建议使用 CONCAT_WS功能。我在本地 mysql 数据库上使用 CONCAT_WS,它运行良好。但它无法在服务器(应用程序托管)上运行并生成以下错误。
FUNCTION test.CONCAT_WS does not exist
错误字符串中的test
是我在服务器上的数据库名称。
我的查询是这样的:
SELECT * FROM patient WHERE CONCAT_WS (',', LastName,FirstName,BirthDate ) NOT IN ('Abdul,Quddus,2000-09-30','Wasim,Akram,1993-09-12');
有人可以告诉我问题或建议我在上面的链接问题中提出的另一个解决方案吗?
谢谢
最佳答案
修复它的最简单方法是删除函数名称和括号之间的空格,即 CONCAT_WS(...)
而不是 CONCAT_WS (...)
.
来自MySQL Manual :
By default, there must be no whitespace between a function name and the parenthesis following it. This helps the MySQL parser distinguish between function calls and references to tables or columns that happen to have the same name as a function.
...
You can tell the MySQL server to accept spaces after function names by starting it with the --sql-mode=IGNORE_SPACE option.
此外,此行为取决于 MySQL 版本,这就是它在一台服务器上工作而在另一台服务器上不起作用的原因,引用“Function Name Parsing and Resolution”手册页:
The number of function names affected by IGNORE_SPACE was reduced significantly in MySQL 5.1.13, from about 200 to about 30.
关于MySQL:CONCAT_WS 函数在本地运行但不在服务器上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3786378/
我试图将几个字段连接成一个字段,但只在结果字符串中保留唯一值。 例子: title_orig | title_fr | title_de | title_it ---
我希望在执行查询时显示以下字符»,但我不断收到以下» 这是我的查询: SELECT CONCAT_WS(' » ',t2.`description`,t1.`description`) AS page
我有 2 张 table 。 第一个表 | idgroup | namegroup 第二个表 | idrequest | col1 | col2 | N1 | N2 | date_extract
通常我们使用 concat_ws 将同一个表上的 2 个字段连接到 1 个字符串中,我如何进行查询以从其他表中选择字段值? GROUP_CONCAT(CONCAT_WS(' - ', item1_fr
我第一次使用 postgresql 时很痛苦,现在的挑战是: 如何执行 concat_ws在 postgresql 中,通过 : 加入一组中的几个字段值 select concat_ws(';',fi
我正在使用 concat_ws 搜索表格(代码如下)。 SELECT * FROM customers WHERE CONCAT_WS('',lastname,firstname) LIKE '%$s
我想为 CONCAT_WS() 选择一个与字段值不冲突的分隔符例如,如果我选择“,”,则字段值可能包含带有“,”的字符串我想选择一个与字段值不冲突的分隔符:( 最佳答案 来自here : CONCAT
几天前我问了一个question关于我的问题,我被建议使用 CONCAT_WS功能。我在本地 mysql 数据库上使用 CONCAT_WS,它运行良好。但它无法在服务器(应用程序托管)上运行并生成以下
如何修改我的 propel 查询以获得与以下 MySQL 查询相同的结果? SELECT v.id,CONCAT_WS(" ",b.name,v.model) AS car_name FROM veh
这个问题不太可能帮助任何 future 的访问者;它只与一个小的地理区域、一个特定的时间点或一个非常狭窄的情况有关,这些情况并不普遍适用于互联网的全局受众。为了帮助使这个问题更广泛地适用,visit
如何对分组查询使用 CONCAT_WS? 这是我的数据库表: 项目 id(PK) itemcode req_id(FK) qualifications duties 我正在尝试运行此查询:
我正在 Presto 中寻找一个函数来用下划线等分隔符连接两列。 最佳答案 您正在这里寻找 array_join功能,见 docs . array_join(x, delimiter, null_re
我正在对 COL1 执行 groupBy 并使用 concat_ws 获取 COL2 的串联列表。我如何获得该列表中的值计数?这是我的代码: Dataset ds = df.groupBy("COL1
我有一个包含 3 个电话列的表,我需要运行一些魔法来尝试获取一些电话号码可以在它们之间匹配的记录,问题是电话号码可能位于 2 条记录之间的不同字段上。 所以我认为包含 3 个电话号码的规范字符串应该允
我有 2 个表,分别名为 vhistory 和 week2。 vhistory 包括两列 voternum 和 voterhistory。 week2 包含列 age、address、voternum
假设我有这张 table id a b 1 data 1234 2 data 我想与分隔符连接(但是)如果没有数据,则不要添加分隔符。 如果我这样做 UPDATE `
MySQL +----+-------------------+----------+--------------+ | id | address | city | sta
这有效 SELECT EntryId FROM 2_1_journal WHERE CAST(CONCAT_WS('-', RecordYear,RecordMonth,RecordDay) AS D
This blog post显示了如何在 Pg 中创建 immutable_concat 函数的示例: CREATE OR REPLACE FUNCTION immutable_concat(VARI
我在 hibernate 查询中使用 CONCAT_WS,创建一个巨大的字符串并使用 like '%value%' 按所有字段进行搜索。它工作正常,但对于某些记录,某些字段为空。例如,如果 actId
我是一名优秀的程序员,十分优秀!