Click here to Skip to main content
15,920,896 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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
Posted
Comments
Sergey Alexandrovich Kryukov 18-Aug-14 1:22am    
Not a correct question. The answer always depends on what's in your database.
This is a question to your database server, not to people.
—SA
Member 10891595 18-Aug-14 1:25am    
okkkkk then tell me what keyword we will use in postgres database at the place of the INSTR in mysql


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
 
Share this answer
 
This will be your query in postgres sql

SELECT OnCName FROM user_name_cno having position('sdfd' in OnCName)>0 
 
Share this answer
 
Comments
Member 10891595 18-Aug-14 3:44am    
do u run this query in ur pc pls run it first on ur pc then tell me

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900