Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> how can you count up the number of columns in a row that have a certain value

how can you count up the number of columns in a row that have a certain value

From: tony <ramdan_at_mailexcite.com>
Date: 25 Mar 1999 18:34:03 -0600
Message-ID: <rBAK2.11164$gn1.40831@newscene.newscene.com>

we have a table with 25 million rows. each row has

acct_# meter_# date read1 read2........read24

1324 123 01/01/99 14 0 4

we would like a count of the rows that have more than 16 of the 24 read columns with a 0 value. we need to exclude then from our analysis.

can somebody post SQL or pl/sql that does this??

also would a bitmap index on the date be of use in speeding up searchs by date they go from 7/1/1998 to 12/1/1998, 180 different dates each repeated 250,000 times or would a regular one better? Received on Thu Mar 25 1999 - 18:34:03 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US