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

  • Home
  • SEARCH
  • 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 8019565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:25:28+00:00 2026-06-04T21:25:28+00:00

I need to achieve a functionality in my project: I have to select 10

  • 0

I need to achieve a functionality in my project:

I have to select 10 rows from a table having 5 columns and then insert the data in same table after updating 2 columns of the data retrieved (from the select query) …what query will do for achieving the same functionality.

example :(10 rows)
data in column1 is ‘zz’,’zz’,’zz’,’zz’,’zz’,’zz’,’zz’,’zz’,’zz’,’zz’.
data in column2 is ‘ClassA’,’ClassB’,’ClassC’,’ClassD’,’ClassE’,’ClassA’,’ClassB’,’ClassC’,’ClassD’,’ClassE’

INSERT INTO tableT (SELECT * FROM tableT (update column1=’yy’,column2=append ‘_tt’ on the existing data in the rows column))

after firing query, we have 20 records, 10 old and 10 new.
10 new records data will be
column1 is ‘yy’,’yy’,’yy’,’yy’,’yy’,’yy’,’yy’,’yy’,’yy’,’yy’
data in column2 is ‘ClassA_tt’,’ClassB_tt’,’ClassC_tt’,’ClassD_tt’,’ClassE_tt’,’ClassA_tt’,’ClassB_tt’,’ClassC_tt’,’ClassD_tt’,’ClassE_tt’

and the data of other remaining 3 columns will be same

please guide me in framing the query

  • 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-04T21:25:29+00:00Added an answer on June 4, 2026 at 9:25 pm

    It depends on the size of your query and on the way you want data to be updated. But for your example you could use

    insert into table (column1,column2)
    select decode(column2,'1','yy','2','zz',null) col1, col2 from table;
    

    EDIT:

    After you changed your question I dont understand what you want to do at all. Please explain this:

    data in column2 is abc,bcd,dce,xyz,etc

    because I dont get the pattern.

    EDIT 2:

    OK. Here we go:

    INSERT INTO <table_name> (col1,col2,col3,col4,col5)
    SELECT col1,col2,col3,col4,col5 
    FROM (
        select  'yy' as col1 , (col2 || '_tt') as col2,col3,col4,col5, rownum r_num 
        from <table_name>
    ) where r_num <= 10;
    

    You didnt specify which 10 rows you want. This will select and change firs 10 rows returned by inner select query.

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

Sidebar

Related Questions

I have an application that stores data in database. I need search functionality to
I'm having an CSS problem, i need to achieve this article div#comments-wrapper ul.sub-comment:before {
This is what i'm trying to achieve: I need to do an Insert on
I need to show an overlay on button click.To achieve this i have written
I need some kind of advise, how to use technologies to achieve following functionality:
I have the following code which requires Ruby 1.9, and I need to achieve
I need some help in adding the replace all functionality into my Flex project.
I need to achieve the following two things in bash: Give a list of
I need to achieve the following query - tags is an internal array in
What I need to achieve is that in every Tab I want to display

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.