Oracle Swap table data using Update query

2014-01-16  Source: Original Site  Category:Oracle  Views:0 

Advertisement

If I have a table T with 4 rows & 2 columns A & B. A has
values 1,2,3,4. and B has 10,20,30,40.

A B
---- --------
1 10
2 20
3 30
4 40

Write an Update SQL query which will Swap the values of A & B for all records.
(Do not use a sub-query)

I faced it as a Multiple choice question. I don't remember the choices exactly but all choices were single line Update queries.

Related articles
  • Oracle Swap table data using Update query 2014-01-16

    If I have a table T with 4 rows & 2 columns A & B. A has values 1,2,3,4. and B has 10,20,30,40. A B ---- -------- 1 10 2 20 3 30 4 40 Write an Update SQL query which will Swap the values of A & B for all records. (Do not use a sub-query)

  • Oracle Export table & data as Sql Query ? 2014-07-16

    Is it possible to export a SQL query of one or more exisiting tables in my dbase. Even better is it possible to export as a sql query the create table as well as the data within it? Im using the fabulous Oracle Sql Developer under Windows 2003. Thank

  • Oracle Copy table data using database link in PL/SQL 2012-04-08

    I would like to copy data into a table in a remote database, from the table in my local database. I cannot use the exp/imp facility and has to do this using the PL/SQL procedures. I have created a dblink to the remote database for this purpose. What

  • Oracle Create table problem using Dynamic Query 2013-05-10

    I want to create a temporary table within a stored procedure so I decided to do it using a dynamic query: [CODE]create or replace procedure p1 as begin execute immediate 'CREATE GLOBAL TEMPORARY TABLE tt(id number(2))'; end; /[/CODE] It created succe

  • Oracle Delete table data use truncate 2015-01-29

    I am using oracle9i. I am use below statement to truncate table for free up the space. is it correct? and i have many table like a001 a002 a003....etc so how can i use only one statement to truncate all table? truncate table sc001.a01; Many

  • error in import table data using oracle datapump 2012-06-06

    i am trying to import table data using oracle datapump CREATE TABLE emp_xt ( ID NUMBER, NAME VARCHAR2(30) ) ORGANIZATION EXTERNAL ( TYPE ORACLE_DATAPUMP DEFAULT DIRECTORY backup LOCATION ('a.dmp') ); it return the following error ORA-29913: error in

  • how to delete duplicate record in a table by using SQL query 2014-03-29

    how to delete duplicate record in a table by using SQL query

  • Use Update Query to Update Table from Another Query 2012-01-11

    I have a date field in CFATABLE that I want to update using a standard query each month. The value will be the maximum date from 13 months data I load each month into another table, which is not directly related to CFATABLE. Can I use a standard quer

  • How to update/query informix table for every update/query on Oracle table 2013-11-10

    We have a system that can talk to only Oracle. Here, we have a certain program that updates an Oracle table thru a View of the Table. For every database operation on Oracle table View, we want to update a corresponding table in Informix database. Sim

  • updating table data from a query 2013-11-22

    I need to be able to update the data value in a numeric field in a table named family, where the value comes from the count of a text field from the member table. The query contains the family and member tables. Every time I try to run the update que

  • Oracle fetching whole table data using OCI calls 2015-02-27

    I am new to OCI programming .I am writing an appliaction in C# to fetch data from ORACLE using OCI calls,Using that application i can able to fecth single row, but i need to load/ fetch the entire table data from the database using the single fetch?

  • Oracle Help needed in Exporting tables data through SQL query 2012-12-11

    I need to write a shell script(ksh) to take some of the tables data backup. The tables list is not static, and those are selecting through dynamic sql query. Can any body tell help me how to write the export command to export tables which are selecte

  • Oracle copying table data accross a dblink using dbms_datapump 2013-04-01

    I need to copy a table data accross a dblink into another table of same structure. There is a requirement to use 10g dbms_datapump package to copy the data. The problem is that I can export into a dump file and then import it into the other database,

  • Oracle Move tables data from One DB to another using DB-Link ? 2015-05-07

    I want to move a table data (for a particular schema) from one database to another database's table (for a particular schema) . Can I do it using DB_Link ? If yes , then plz tell me the way , how can I do it ?

  • Oracle How to initialize in update query with date... 2012-04-28

    How do I do this update query to set the fields to 1/1/1999: I tried this: CREATE OR REPLACE PROCEDURE update_install_plan_date_na ( p_ID integer, p_UpdatedBy varchar2 :=NULL ) AS BEGIN UPDATE Z_WBSInstallDate SET MECH = '1/1/1999', ELEC = '1/1/1999'

  • Oracle Need Help for 2nd Highest Salary from emp table without using inner Query 2014-12-29

    I have this Query for getting the second highest Salary using inner query SQL> select max(sal) from emp where sal not in(select max(sal) from emp); But i want to get the Second highest Salary without using INNER QUERY Any Idea

  • Oracle Question/problem on an update query 2013-05-27

    I am having a strange problem with an update query I am running. Here are the specifics: 1. I run a script that extracts qualifying rows form a source table (S1), performs some calculation,s and stores the results in a temporary table (T1). 2. The ca

  • Oracle Two different results using one query 2015-04-03

    Oracle version that I am using is : Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production With the Partitioning, OLAP and Data Mining options I have a scenario where one account can be related to two customers. Hence, in table

  • How do I use Update Query 2015-05-27

    I want to update a record in an existing table. I have two tables tblHeader and tbllines When the status of the lines is updated I want to also update the status in the header table. I have set up an update query but am obviously missing the point he

  • Oracle Export table data only 2012-03-01

    I am wondering if anyone can offer some advice in regards to export table data from a source and import it to another system. We have a development environment (say, Banner_dev) and a production one (say, Banner_Prod). We routinely perform database r