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

Difference between truncate, delete and drop commands?

0 Answers  


What are all types of user defined functions?

0 Answers  


How would you pass hints to the sql processor?

0 Answers  


If a cursor is open, how can we find in a pl/sql block?

0 Answers  


Is not null in sql?

0 Answers  






What is vector point function?

0 Answers  


How to execute multiple sql statements in a single annonymous block irrespective of the sql statement result?

2 Answers  


What can sql server reporting services do?

0 Answers  


How to write a procedure for displying the data in a TREE or (PARENT and CHILD ) relationship , for ex: A is the main project id, for this project B,C,D are sub tasks(sub project id's) for B the sub tasks are e,f,g and for c is h ,i ,j and for d is k,l,m now i need to display the o/p in a TREE fashion pls help me , thanks in advance surendra

2 Answers   Zensar,


Does truncate remove indexes?

0 Answers  


What are reports usually used for?

0 Answers  


what is a scheduled jobs or what is a scheduled tasks? : Sql dba

0 Answers  


Categories