Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6162223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:37:01+00:00 2026-05-23T21:37:01+00:00

this is the query: SELECT DISTINCT pprom.pk FROM ( SELECT item_t0.SourcePK as pk FROM

  • 0

this is the query:

SELECT DISTINCT pprom.pk
FROM
(
    SELECT
      item_t0.SourcePK as pk
    FROM
      links item_t0
    WHERE (? =  item_t0.TargetPK   AND  item_t0.SourcePK  in (?,?))
    AND (item_t0.TypePkString=? )
    UNION
    SELECT
      item_t1.TargetPK as pk
    FROM
      cat2prodrel item_t1
    WHERE ( item_t1.SourcePK  in (? )  AND  item_t1.TargetPK  in (?,?))
    AND (item_t1.TypePkString=? )
) AS pprom

And this is the error:

ORA-00933: SQL command not properly ended

Any ideas what could be wrong?

Edit:

The question marks are replaced by PKs of the respective items:

values = [PropertyValue:8802745684882, PropertyValue:8796177006593, PropertyValue:8796201713665, 8796110520402, PropertyValue:8796125954190, PropertyValue:8796177006593, PropertyValue:8796201713665, 8796101705810]

Edit 2:

The query is executed deep inside some proprietary software system so I don’t know exactly the code that runs it.

Edit 3:

I found one more query that’s a little shorter but results in the same error message:

SELECT DISTINCT pprom.pk 
FROM 
( 
    SELECT  
        item_t0.SourcePK  as pk 
    FROM 
        links item_t0 
    WHERE (? =  item_t0.TargetPK  AND  item_t0.SourcePK  in (?)) 
        AND (item_t0.TypePkString=? )  
) AS pprom

Using the following values:

values = [PropertyValue:8799960601490, PropertyValue:8796177006593, 8796110520402]

Edit 4

I found the SQL code that is sent to the db after replacing the values:

SELECT DISTINCT pprom.pk 
FROM 
( 
    SELECT  
        item_t0.SourcePK  as pk 
    FROM 
        links item_t0 
    WHERE (8801631769490 =  item_t0.TargetPK   AND  item_t0.SourcePK  in (8796177006593)) 
        AND (item_t0.TypePkString=8796110520402 )  
) AS pprom

I also tried executing the inner SELECT statement and that alone runs ok and returns a single PK as a result.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:37:02+00:00Added an answer on May 23, 2026 at 9:37 pm

    I could not find any obvious syntax error in your query so I’d presume the issue is the client library you are using to convert the ? place holders into actual values. Your question edit displays a sort of dump where there are 8 integers but only 6 PropertyValue items. Make sure that’s not the issue: IN (?, ?) requires 2 parameters.

    Edit

    Try removing the AS keyword when you assign an alias to the subquery:

    SELECT DISTINCT pprom.pk 
    FROM 
    ( 
        SELECT  
            item_t0.SourcePK  as pk 
        FROM 
            links item_t0 
        WHERE (8801631769490 =  item_t0.TargetPK   AND  item_t0.SourcePK  in (8796177006593)) 
            AND (item_t0.TypePkString=8796110520402 )  
    ) AS pprom
      ^^
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this query: SELECT DISTINCT pat.PublicationID FROM dbo.PubAdvTransData AS pat INNER JOIN
I have this query: SELECT DISTINCT IM.EDIFICIOS_ID, TI.TITULAR FROM IMPORTACION IM INNER JOIN I_EDIFICIO
Let say that we have the following query: SELECT DISTINCT COUNT(`users_id`) FROM `users_table`; this
So if my JPA query is like this: Select distinct p from Parent p
i don't know how to translate this query : SELECT distinct(id_ville) FROM `point_location` I
I have this query that uses a UNION: $this->db->query(' SELECT DISTINCT users.user_pic, users.id, users.username,
I have this sql query: SELECT DISTINCT url FROM paragraphs WHERE MATCH (title) AGAINST('$query')
i am joining 2 tables using this query SELECT DISTINCT (member.id), member_type FROM member
I have this query SELECT distinct username, time FROM `sadaat`.`wp_loginlog` where username != 'admin'
So I have this query: SELECT DISTINCT(b.friend_id) AS possible_id FROM friend_friends a JOIN friends_friends

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.