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 9164233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:37:58+00:00 2026-06-17T14:37:58+00:00

The commented (/* */) part of this query executes but the whole query am

  • 0

The commented (/* */) part of this query executes but the whole query am getting problem in /////// part.Please hlep to solve this.

 SELECT *
    FROM (

 /*   (SELECT U1.EMAIL, S1.GRNNUM
       FROM RDT_USER U1,
            (SELECT O.ID, GRNNUM
               FROM RDT_ORGANIZATION O,
                    (SELECT GRNNUM, RECEPIENTCODE, ORGINATORCODE
                       FROM RDT_GOODSRECEIPTNOTE M
                      WHERE M.ACTIONSTATUS = 0
                        AND M.LATEST = 1
                        AND (SYSDATE - M.GENDATE) >= 0) S
              WHERE O.FUCODE = S.ORGINATORCODE) S1

      WHERE U1.ORGID = S1.ID)*/ A///////here am getting right paranthesis missing,

    (SELECT U.EMAIL, T1.GRNNUM
       FROM RDT_USER U,
            (SELECT O.ID, GRNNUM
               FROM RDT_ORGANIZATION O,
                    (SELECT GRNNUM, RECEPIENTCODE, ORGINATORCODE
                       FROM RDT_GOODSRECEIPTNOTE M
                      WHERE M.ACTIONSTATUS = 0
                        AND M.LATEST = 1
                        AND (SYSDATE - M.GENDATE) >= 0) T
              WHERE O.FUCODE = T.ORGINATORCODE) T1

      WHERE U.ORGID = T1.ID) B)
 WHERE A.GRNNUM = B.GRNNUM
  • 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-06-17T14:37:59+00:00Added an answer on June 17, 2026 at 2:37 pm

    Those two subqueries/inline views need to be connected in some way. You probably want a cross join — indicated by the comma between them — in which case, you can also remove a set of parentheses:

    SELECT *
    FROM   (SELECT U1.EMAIL, S1.GRNNUM
            FROM   RDT_USER U1,
                   (SELECT O.ID, GRNNUM
                    FROM   RDT_ORGANIZATION O,
                           (SELECT GRNNUM, RECEPIENTCODE, ORGINATORCODE
                            FROM   RDT_GOODSRECEIPTNOTE M
                            WHERE  M.ACTIONSTATUS = 0
                            AND    M.LATEST = 1
                            AND    (SYSDATE - M.GENDATE) >= 0) S
                    WHERE  O.FUCODE = S.ORGINATORCODE) S1
    
            WHERE U1.ORGID = S1.ID) A,
    
           (SELECT U.EMAIL, T1.GRNNUM
            FROM   RDT_USER U,
                   (SELECT O.ID, GRNNUM
                    FROM   RDT_ORGANIZATION O,
                           (SELECT GRNNUM, RECEPIENTCODE, ORGINATORCODE
                            FROM   RDT_GOODSRECEIPTNOTE M
                            WHERE  M.ACTIONSTATUS = 0
                            AND    M.LATEST = 1
                            AND    (SYSDATE - M.GENDATE) >= 0) T
                    WHERE  O.FUCODE = T.ORGINATORCODE) T1
            WHERE U.ORGID = T1.ID) B
     WHERE  A.GRNNUM = B.GRNNUM;
    

    EDIT The more I look at your query, the more I see problems with it.

    1. Your inline views/subqueries are identical. The only effect cross joining them will have is to increase execution time.
    2. Why are you doing cross joins? Inner joins will suffice.
    3. Your inner queries are missing some column specs, which you are referencing in outer queries for the join. This won’t work.

    The core of your query is basically this logic:

    select grnnum,
           recepientcode,
           originatorcode
    from   rdt_goodsreceiptnote
    where  actionstatus       = 0
    and    latest             = 1
    and    sysdate - gendate >= 0;
    

    You are then cross joining this with rdt_organization, then cross joining that with rdt_user; this mess is then crossed with itself, for some reason. This can be greatly simplified with inner joins:

    select rdt_user.email,
           rdt_goodsreceiptnote.grnnum
    
    from   rdt_goodsreceiptnote
    
    join   rdt_organization
    on     rdt_organization.fucode = rdt_goodsreceiptnode.originatorcode
    
    join   rdt_user
    on     rdt_user.orgid = rdt_organization.id
    
    where  rdt_goodsreceiptnode.actionstatus       = 0
    and    rdt_goodsreceiptnode.latest             = 1
    and    sysdate - rdt_goodsreceiptnode.gendate >= 0;
    

    There’s no reason for you to do this twice, in a cross join, so that’s it. Much easier, huh?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a query like this: select display_order , section_name , solution_section_id from solution_sections
This query doesn't complete in a reasonable amount of time: mysql> select * from
I have a query like this: SELECT c.review, u.username, c.date, c.good, c.rate_id, r.rating FROM
I tried prepared statement in my program, but not working. The part commented is
In code, the commented part is what I need to solve... Is there a
I have the following query EXPLAIN SELECT COUNT(DISTINCT ip_address) as ip_address, exec_date FROM requests
Here is my query: SELECT COUNT(`id`) FROM `comments` WHERE `user_id` != '1' -- Author
I need to find the best index for this query: SELECT c.id id, type
I have the following MySQL query: SELECT pool.username FROM pool LEFT JOIN sent ON
I'm having a bit of a problem with a SELECT query in MySQL and

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.