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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:39:57+00:00 2026-05-11T22:39:57+00:00

We have a table that is used for assessment-values in our tool where each

  • 0

We have a table that is used for assessment-values in our tool where each value has its valueid. Dont ask me who came up with this so called design, but now I need to add multiple valueids to the end for each assessment.

So, it looks like this:

AssessmentId 1, ValueId 1, Value
AssessmentId 1, ValueId 2, Value
AssessmentId 1, ValueId 3, Value
AssessmentId 2, ValueId 1, Value
AssessmentId 2, ValueId 2, Value
AssessmentId 2, ValueId 3, Value

I now probably need a subquery that returns all distinct assessmentids and for each of those I add my rows

AssessmentId 1, ValueId 7, empty
AssessmentId 1, ValueId 8, empty
AssessmentId 1, ValueId 9, empty
AssessmentId 2, ValueId 7, empty
AssessmentId 2, ValueId 8, empty
AssessmentId 2, ValueId 9, empty
...

Honestly, I have no clue how to achieve this. Maybe a subselect with a group, but how would I then get the selected assessmentid into the new insert?

Edit:
well, actually we have 709 values for each assessment and now we need 24 more at the end for additional data

foreach distinct assessmentid in table
{ 
   insert row (assessmentid, 710, null); 
   insert row (assessmentid, 711, null); 
   ... 
   insert row (assessmentid, 733, null); 
}

something like this

  • 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-11T22:39:57+00:00Added an answer on May 11, 2026 at 10:39 pm
    INSERT
    INTO    i_should_really_name_the_tables_i_ask_about_on_stackoverflow_com (assessmentid, valueid)
    SELECT  assessmentId, valueMax + lvl
    FROM    (
            SELECT  assessmentId, MAX(valueId) AS valueMax
            FROM    i_should_really_name_the_tables_i_ask_about_on_stackoverflow_com t
            GROUP BY
                    assessmentId
            ) a
    CROSS JOIN
            (
            SELECT  level AS lvl
            FROM    dual
            CONNECT BY
                    level <= 24
            ) l
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 123k
  • Answers 123k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think the best option would be Microsoft ASP.NET MVC… May 12, 2026 at 1:03 am
  • Editorial Team
    Editorial Team added an answer FWIW this has changed in SL3 RTM: Silverlight 3 Beta… May 12, 2026 at 1:03 am
  • Editorial Team
    Editorial Team added an answer int value; BOOL success = [[NSScanner scannerWithString:@"1000safkaj"] scanInteger:&value]; If the… May 12, 2026 at 1:03 am

Related Questions

I have a table with about 10 fields to store gps info for customers.
I have a table in a SQL Server 2005 Database that is used a
Currently we have a table that we use to track inivitations. We have an
I have a table containing user input which needs to be optimized. I have
We have a problem here. We need to translate a website into multiple language.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.