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
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 |
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 |
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 |
What is offset and limit in sql?
What are inbuilt functions in sql?
How many triggers can be implemented for a table?
What is t sql in sql server?
What is constant in pl sql?
How many tables can you join in sql?
What is Pragma EXECPTION_INIT ? Explain the usage ?
What is a stored procedure ?
How do I kill a query in postgresql?
Which version of sql do I have?
What are aggregate functions in sql?
Is and as keyword in pl sql?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)