Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Query is not working in postgresql(support ANSI standared)

2875841Jun 20 2017 — edited Jun 21 2017

Hi

So how can I write ANSI sql for below query

SELECT w.test_id,

  (SELECT comp_code FROM compnay WHERE compnay_id = W.VALUE

  )

FROM testTable W where w.value !='Any'

Here testTable contains a column  "value(VARCHAR)" and it can have both integer and string values.

But company_id is an integer field .Its working when connecting to oracle .But not working in postgresql.(org.postgresql.util.PSQLException: ERROR: operator does not exist: numeric = character varying)

Can anyone help me to write this query to execute in all db.

Regards

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 19 2017
Added on Jun 20 2017
12 comments
742 views