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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:02:31+00:00 2026-05-26T07:02:31+00:00

I’ve to fill an empty table (TAB_A) with random records (5%) from TAB_B, joined

  • 0

I’ve to fill an empty table (TAB_A) with random records (5%) from TAB_B, joined with other 3 tables (C1, C2, C3).

Now, if I run the following query everything works well:

INSERT INTO TAB_A (field1,field2)
    SELECT TAB_B.ID_TASS, TAB_B.ID_SEZ
    FROM (SELECT TAB_B.*, row_number() 
            OVER (ORDER BY dbms_random.VALUE) r 
            FROM TAB_B) 
    WHERE r < (SELECT COUNT(*) FROM TAB_B)*0.05

The problem is that I need also to fill in the TAB_A.field3 whose values are in TAB_C3.
So I rewrite my previous query:

INSERT INTO TAB_A (field1,field2,field3)
    SELECT B.ID_TASS, B.ID_SEZ, C3.Z_ID
    FROM (SELECT B.*, row_number() 
            OVER (ORDER BY dbms_random.VALUE) r 
            FROM TAB_B B
                JOIN TAB_C1 C1 on C1.X_ID = B.X_ID
                JOIN TAB_C2 C2 on C2.Y_ID = C1.Y_ID
                JOIN TAB_C3 C3 on C3.Z_ID = C2.Z_ID
            WHERE C3.Z_ID = 9) 
    WHERE r < (SELECT COUNT(*) FROM B)*0.05

but an error occurs: ORA-00904: “C3.Z_ID” invalid identifier.

I think the problem could be in the statement “SELECT B.ID_TASS, B.ID_SEZ, C3.Z_ID“, that I changed in “SELECT TAB_B.ID_TASS, TAB_B.ID_SEZ, TAB_C3.Z_ID“…. but without success: the same error occurs again.

By the way, the following query works perfectely:

select count(*)
    from TAB_B B
        JOIN TAB_C1 C1 on C1.X_ID = B.X_ID
        JOIN TAB_C2 C2 on C2.Y_ID = C1.Y_ID
        JOIN TAB_C3 C3 on C3.Z_ID = C2.Z_ID
    WHERE C3.Z_ID = 9

Can anybody help me?

  • 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-26T07:02:32+00:00Added an answer on May 26, 2026 at 7:02 am

    try

    …

    SELECT B.ID_TASS, B.ID_SEZ, C3_Z_ID

    FROM (SELECT B.*, C3.Z_ID AS C3_Z_ID, row_number()
    …

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.