including the missing data into table
876673Aug 9 2011 — edited Aug 9 2011Hi friends,
I have the data like below in my table which I need to format it like the table 2.
Table1:
Number col1 Col2
2 4 8
3 8 8
5 3 4
7 2 2
Table 2:
Number col1 Col2
1 0 0
2 4 8
3 8 8
4 0 0
5 3 4
6 0 0
7 2 2
8 0 0
9 0 0
10 0 0
query to get the data for table one:
select number, col1, col2 from yyy_view order by number asc;
I need to get the missing number values from table one and include the missing rows with corresponding numbers and zeros for the columns. It is only for the select and not inserting data to the table/view.
I need to get the numbers from 1 till 10 and then minus it with the set of numbers present in the table one and then union both table one and missing data. How to write this in a query.
Kindly let me know.