suppose we have values like 1 5 7 in a colum.Now we want
numbers like(2 3 4 6) that exists between 1 5 7.How can we
do this using sql query??
Answer Posted / elumalai d
--QUESTION36:-What is different between union and minus?
UNOIN:- it returns all the records from both tables without duplicates.
Example:-
A={1,2,3,4}
B={2,3,4,5,6}
AUB={1,2,3,4,5,6}
CREATE TABLE question36 (empid NUMBER);
CREATE TABLE quest36 (empid NUMBER);
INSERT INTO question36 VALUES(1);
INSERT INTO question36 VALUES(2);
INSERT INTO question36 VALUES(3);
INSERT INTO question36 VALUES(4);
INSERT INTO quest36 VALUES(2);
INSERT INTO quest36 VALUES(3);
INSERT INTO quest36 VALUES(4);
INSERT INTO quest36 VALUES(5);
INSERT INTO quest36 VALUES(6);
COMMIT;
SELECT empid FROM question36
UNION
SELECT empid FROM quest36;
DELETE FROM question36;
DELETE FROM quest36;
COMMIT;
MINUS:- it returns table A values not available in table B.
Example:-
A={1,2,3,4}
B= {2,3,5}
A-B={1,4}
INSERT INTO question36 VALUES(1);
INSERT INTO question36 VALUES(2);
INSERT INTO question36 VALUES(3);
INSERT INTO question36 VALUES(4);
INSERT INTO quest36 VALUES(2);
INSERT INTO quest36 VALUES(3);
INSERT INTO quest36 VALUES(5);
COMMIT;
SELECT empid FROM question36
MINUS
SELECT empid FROM quest36;
DROP TABLE question36;
DROP TABLE quest36;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is partition in sql query?
what is the functionality of the function htmlentities? : Sql dba
what are the differences between binary and varbinary? : Sql dba
how can we transpose a table using sql (changing rows to column or vice-versa) ? : Sql dba
Explain the order of sql statement execution?
How do I get sql certification?
What are the methods of filing?
Which are the different case manipulation functions in sql?
What is set serveroutput on in pl sql?
What is the difference between nvl function, ifnull function, and isnull function?
What does over partition by mean in sql?
What is a procedure in pl sql?
What is database sql?
Where is pl sql used?
What is the most common sql injection tool?