how to write a SQL query for checking 200 fields of a table. Hi , I have a big table of 250 column. Out of 250 , 200 columns has the amount field. e.g. amount 1 , amount 2 ......amount 200. I need to select all the rows from the table where any of the two amount column has some data ( means some amount value). The amount value can be in -ve too -54.6, can be 56 and can be 56.00. Most of the empty field have amount as 0. I don’t want to use any cursors or PL/ SQL. Is it possible to write a SQL query may be with sub query to select the rows with above condition. If this is not at all possible then what would be the best approach to use the pl/sql and cursor to get this. This query is just for analysis purpose and I can’t get everything in cursor/result set to fetch row by row later in the java code or anywhere else. The database is an oracle Database. |