how can we replace the particular column value of a resulted
set of executed query? I mean write down a sql query to
chane the particular column's value of a resulted set of
executed query

Answers were Sorted based on User's Feedback



how can we replace the particular column value of a resulted set of executed query? I mean write do..

Answer / m.raghu

by using sub query answer is

update table1 set col1=(select col2 from table2 where
<cond>)

Is This Answer Correct ?    2 Yes 1 No

how can we replace the particular column value of a resulted set of executed query? I mean write do..

Answer / mglbayar

UPDATE (SELECT t1.col1 c1, t2.col1 c2
FROM table1 t1, table2 t2
WHERE t1.pk = t2.fk AND more_condition)
SET c1 = c2;

Is This Answer Correct ?    2 Yes 1 No

how can we replace the particular column value of a resulted set of executed query? I mean write do..

Answer / suma

select decode(salary,2500,1000,3000,2500, 3000) from
employees;
This query will replace the salary column value from
employees.
If the salary is 2500 then 1000 is displayed in the
resultset, else if 3000 then 2500 will be displayed esle
2000 is displayed.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

- Types of triggers - View - Dcl - Procedures, packages, functions - Metasolve - Can use Dcl in triggers - package case study - Cursor and its types - triggers schedule - Wrap - Why we are using fetch and for in cursor. difference?

0 Answers   CTS,


how to convert numeric values to character strings? : Sql dba

0 Answers  


can i use dbms_output.put_line in a function u are telling as return statement

7 Answers  


What is the main difference between sql and pl/sql?

0 Answers  


How does cross join work in sql?

0 Answers  






What do you mean by field in sql?

0 Answers  


What is a primary key called that is made up of more than one field?

0 Answers  


how to find 5th row ?

10 Answers  


25.67,-1 Trunc = 20 Round= 30 HOW????

2 Answers   Karrox,


What is a full join sql?

0 Answers  


what is Difference between Having and Where clause?

5 Answers   IBM,


what is the difference between where clause and having clause? : Sql dba

0 Answers  


Categories