sql - Count Rows using Multiple Select Statements -


purpose count rows multiple ( 9 in total ) select statements , display row count in application on php page. using oracle 11g db

dont care selecting content right here - need rowcount.

i haven't found great way count rows oracle , using select statements.

what best way count rows multiple selects , oracle , display on php page ??

please provide examples

this have, 9 times

$query  = oci_parse($conn, "select id" . " table a" . " (fieldx = 'n' , fieldy = 'y' , fieldz = 'y')");  oci_execute($query) or die(oci_error($query)); oci_fetch_all($query, $array); unset($array); $numberofrows1 = oci_num_rows($query);  

how can make more efficient ??

i try use field indexed or pk in select...

this:

$query  = oci_parse($conn, "select count( * ) the_count" . " table a" . " fieldx = 'n'" . " , fieldy   = 'y'" . " , fieldz   = 'y'");  oci_execute($query) or die(oci_error($query)); oci_fetch_all($query, $array); 

will return 1 row 1 column named the_count containing count of rows in table matching specified criteria.


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -