Question

In SQL, how do I put one column from one table right next to another column...

In SQL, how do I put one column from one table right next to another column from a different table?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Using Sql query:-

Consider we have a two table "presentTable" and "targetTable".We want to copy a column "presentColumn" from "presentTable" to "targetColumn" of "targetTable".

*Note:-The target table column i.e"targetColumn" should be empty and "presentColumn" should contain data,Then write the following sql query:-

Update targetTable SET targetColumn=(

Select presentColumn from presentTable where presentTable.Id=targetTable.Id

);

Add a comment
Know the answer?
Add Answer to:
In SQL, how do I put one column from one table right next to another column...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • How do I set a column attribute with value from another table? I have this manager_specialisation table: CREATE TABLE ma...

    How do I set a column attribute with value from another table? I have this manager_specialisation table: CREATE TABLE manager_specialisation ( specialisation_id NUMBER(4) NOT NULL, specialisation_type VARCHAR(50) NOT NULL ); And I want to update a column in my garage_manager table like this except the specialisation_id is WHERE specialisation_type = 'S'.? UPDATE garage_manager SET specialisation_id=manager_specialisation.specialisation_id WHERE man_id=1 AND garage_email= (SELECT garage_code FROM garage WHERE garage_email = 'melbournec@rdbms.example.com') ;

  • WRITE A SQL QUERY SQL SERVER Write a SELECT statement that returns one column from the...

    WRITE A SQL QUERY SQL SERVER Write a SELECT statement that returns one column from the Customers table named FullName that joins the LastName and FirstName columns. --       Format this column with the last name, a comma, a space, and the first name like this: --       Doe, John --       Sort the result set by last name in ascending sequence. --       Return only the contacts whose last name begins with a letter from M to Z. --  ...

  • (Using Oracle SQL) How do I find the primary key of this table? And then how...

    (Using Oracle SQL) How do I find the primary key of this table? And then how do I consequently drop the primary key from the table? Edit: I was already give this code and it did not work select constraint_name,constraint_type from user_constraint where table_name='CUSTOMER'; Q7 (10 Points) Use ONE SQL statement to find out the name of the primary key constraint defined on Customer table. (Your SQL should return something like SYS_C0021715, numbers on your account may differ.) Then use...

  • In oracle sql, how do I add "not null constraint" at end of create table block...

    In oracle sql, how do I add "not null constraint" at end of create table block and give it a name without using the CHECK constraint? Is it e.g., CONSTRAINT constraintName NOT NULL If so, then how does the statement know which columnName I'm referring to to make NOT NULL? I know that I can do this after declaring the column, what I'm wondering about is how to do this after declaring all the columns.

  • this is sql developer question I just need the format of how to answer question! Create...

    this is sql developer question I just need the format of how to answer question! Create sequences (2) that can be used to number the member ID and group ID values starting with 3 (since you already have 1 and 2). Write an INSERT statement that adds another row to the Groups table, make up a group name. Use the NEXTVAL pseudo column to get the value for the next group ID from the sequence that you created in #5....

  • Hello this is for SQL. How do i only return a row that has a 9...

    Hello this is for SQL. How do i only return a row that has a 9 or a 2 from the invoice_number column?

  • Query question? table name:employee column name:birth_date Birth date format is 14-OCT-61 day-month-year How do I get...

    Query question? table name:employee column name:birth_date Birth date format is 14-OCT-61 day-month-year How do I get that date to display in a column as 10/14/1961? in SQL

  • Which SQL statement retrieves the EmployeeName and City columns from the Employees table? O LIST EmployeeName,...

    Which SQL statement retrieves the EmployeeName and City columns from the Employees table? O LIST EmployeeName, City ON Employees; O FIND EmployeeName, City ON Employees; SELECT EmployeeName, City FROM Employees; O RETRIEVE EmployeeName, City FROM Employees; Which SQL statement finds the different cities in which national parks reside with no duplicate rows listed? SELECT DISTINCT city FROM natlpark ORDER BY city; O ORDER BY natlpark DISTINCT city; O ORDER BY city FROM natlpark; O SELECT city FROM natlpark ORDER BY...

  • Put all of your SQL code in a file named grades.sql and submit it below. Download...

    Put all of your SQL code in a file named grades.sql and submit it below. Download the starter code, which contains import_grades.sql and the grades.csv file. Using he import_grades, sql file, create your database and table. - 0 eded. 1 T Une Modify the LOAD DATA INFILE to correct the path to load the grades.csv file, and add/remove LOCAL he only modification you may make to the import_grades.sql or the grades.csv files. The data represents grades for assignments in a...

  • How do I go from one concentration of cells to another? In this case, I have...

    How do I go from one concentration of cells to another? In this case, I have 4,235*5*10^5 cells/mL, but I need a concentration fo 10*10^4 cells/mL. How do I dilute it with the medium?

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT