Sql query MINUS operator
by Mohan[ Edit ] 2014-05-31 15:34:19
Sql query MINUS operator
Sql query :
Table 1
S.No |
Supplierid |
date |
1 |
11 |
07/01/2014 |
2 |
12 |
05/02/2014 |
3 |
13 |
15/02/2014 |
Table 2
S.No |
Supplierid |
date |
1 |
11 |
07/01/2014 |
2 |
12 |
15/02/2014 |
Sql query: SELECT date FROM table1 MINUS SELECT date FROM table2;
will give result
The dates 15/02/2014,07/01/2014 are present in table1 and table2 database tables.The minus operator in the above sql results in distinct values of date from table1 and table 2..