以下查询返回什么 [英] what does following query return

查看:56
本文介绍了以下查询返回什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下查询将返回





SELECT OnCName FROM user_name_cno具有INSTR('sdfd',OnCName)> 0

用mysql编写的这个查询我希望在postgres中构建相同的查询







所以请帮我缩短这个查询

解决方案

会员10891595写道:

okkkkk然后告诉我我们将在mysql的INSTR位置的postgres数据库中使用什么关键字

你可以自己轻松找到它。这是一个特定于MySql的指令,可以使用其他字符串函数来实现。



请参阅此代码,该代码也适用于Postgres: http://www.postgresql.org/docs/7.4/static/plpgsql- porting.html#PLPGSQL-PORTING-APPENDIX [ ^ ]。



-SA


< blockquote>这将是你在postgres中的查询sql



 SELECT OnCName FROM user_name_cno有位置(OnCName中的'sdfd')> 0 


what will be following query return


SELECT OnCName FROM user_name_cno having INSTR('sdfd',OnCName)>0
this query written in mysql and i want to build same query in postgres



so pls help me short out this query

解决方案

Member 10891595 wrote:

okkkkk then tell me what keyword we will use in postgres database at the place of the INSTR in mysql

You could easily find it yourself. This is an instruction specific to MySql, which can be implemented using other string functions.

Please see this code, which is supposed to work in Postgres as well: http://www.postgresql.org/docs/7.4/static/plpgsql-porting.html#PLPGSQL-PORTING-APPENDIX[^].

—SA


This will be your query in postgres sql

SELECT OnCName FROM user_name_cno having position('sdfd' in OnCName)>0 


这篇关于以下查询返回什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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