Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 在SQL中使用特定的字符串大写_Mysql_Sql_Postgresql - Fatal编程技术网

Mysql 在SQL中使用特定的字符串大写

Mysql 在SQL中使用特定的字符串大写,mysql,sql,postgresql,Mysql,Sql,Postgresql,我正在尝试将特定字符串改为大写,我的代码是 update $table set work_log_history = concat(("$created_by response on $toDate $history"||chr(10)),work_log_history) where id="$id" 在上面的查询中,我想使用字符串大写形式创建$created\u。使用upper函数 更新table_name set field=upperfield,其中id=1我认为在这种情况下,UP

我正在尝试将特定字符串改为大写,我的代码是

update $table 
set work_log_history = concat(("$created_by response on $toDate $history"||chr(10)),work_log_history) 
where id="$id"
在上面的查询中,我想使用字符串大写形式创建$created\u。

使用upper函数


更新table_name set field=upperfield,其中id=1

我认为在这种情况下,UPPER函数应该适合您?请参阅此处的文档:

因此,您的代码如下所示:

update $table 
set  work_log_history=concat((UPPER($created_by)," response on $toDate $history"||chr(10)),work_log_history) 
where id="$id"

更新$table set work_log_history=concatUPPER'$created_by','\t响应$toDate$input_data->{comment}'| chr10,work_log_history,其中id='$id',工作正常。

将3个参数传递给concat,然后使用upperstring函数使字符串大写尝试以下操作:更新$table set work_log_history=concatUPPER$由$toDate$history | chr10上的响应创建,work_log_history,其中id=$idUPPERnamburi响应于2017年12月7日。结果类似于此UPPER也附加在其上。@DiabolusThanx@ViswanathPolaki有效。您使用的是MySQL还是Postgresql?不要标记未涉及的产品。我只想将$created\u by转换为大写。在您的案例中,整个字符串都转换为大写。感谢您让我知道,我已在上面的代码中将$created\u by的大写部分分离出来