Using Oracle SQL query find output

Question!
Table 1             table2

col1    col2        col1    col2
-------------       -------------
   1     2             8     5
   -    10             9     -
   3     4             5     4
  89     -             7     3
   5     6             -    87

Output #1:

col1    col2
1   -
10  -
3   7
89  -
5   8

Output #2:

col1    col2
2   1
4   3
5   4
6   5
7   3   
8   5


Answers

If you need the queries to produce these two outputs from the given input data, here they are:

Output #1

select  nvl(table1.col1, table1.col2) col1,
        table2.col1 
from    table1 
        left join table2 
            on table1.col1 = table2.col2 

Output #2

select  col2, col1
from    table1 
where   col1 + col2 is not null
union   all
select  col1, col2
from    table2
where   col1 + col2 is not null

Anyway, the answer would be more reasonable if you ask a question :)



To make sure all fields are filled before submission of the form:

<input type="radio" required>

The ' required ' attribute makes sure all fields are filled before the form can be submitted.



I don't have the privalage to comment but you can use the required field as follows

 <input type="radio" name="question-1-answers" id="question-1-answers-A" value="A" required=true />

using this way the user will have to click all the required fields before submitting a form.



This video can help you solving your question :)
By: admin