wirte a query to remove null? following table are
col1 col2 col3
dinesh null null
null suresh null
null null prakesh
i want the output like
col1 col2 col3
dinesh suresh prkaesh
Answers were Sorted based on User's Feedback
Answer / kart
select max(col1) col1,max(col2) col2,max(col3) col3
from table;
col1 col2 col3
dinesh suresh prkaesh
| Is This Answer Correct ? | 11 Yes | 4 No |
Answer / sivanagaraju
SELECT DISTINCT((SELECT COL1 FROM COLL WHERE COL1<>'NULL')),(SELECT COL2 FROM COLL WHERE COL2<>'NULL'),(SELECT COL3 FROM COLL WHERE COL3<>'NULL')
FROM COLL
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / sivanagaraju
SELECT C1.COL1,C2.COL2,C3.COL3
FROM COLL C1,(SELECT COL2 FROM COLL WHERE COL2 <>'NULL') C2,
(SELECT COL3 FROM COLL WHERE COL3<>'NULL') C3
WHERE C1.COL1<>'NULL';
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / sivanagaraju
SELECT C1.COL1,C2.COL2,C3.COL3
FROM (SELECT COL1 FROM COLL WHERE COL1 <>'NULL') C1,
(SELECT COL2 FROM COLL WHERE COL2 <>'NULL') C2,
(SELECT COL3 FROM COLL WHERE COL3<>'NULL') C3
WHERE C1.COL1 <>'NULL' AND C2.COL2<>'NULL';
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / apsar
select distinct((select col1 from z1 where no is not null))col1,(select col2 from z1 where sal is not null)col2,select col3 from z1 where col is not null) from z1
Hint:z1 is Table Name
| Is This Answer Correct ? | 0 Yes | 1 No |
a. Can you delete data from a View. b. If Yes, can you delete it if there are multiple tables c. If No, can you delete if there is single source table which is joining.
what is overloading procedure or overloading function ?
What is a ddl command?
how to retrieve only duplicate values in a table
How many triggers can be applied on a table?
How do I start sql profiler?
How can we schedule the procedure to run automatically ?
How to start oracle sql developer?
what is the maximum length of a table name, database name, and fieldname in mysql? : Sql dba
what is the syntax used for partition in tsql? : Transact sql
What is Data Concarency and Consistency?
Explain the select statement in 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)