how to write a SQL query for checking 200 fields of a table.

This is a discussion on how to write a SQL query for checking 200 fields of a table. within the Oracle forums in Oracle Database category; 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 ...

Go Back   Database Forum > Oracle Database > Oracle

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 06-10-2008, 11:05 AM
Default 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.
Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 04:15 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.