List:General Discussion« Previous MessageNext Message »
From:Adarsh Sharma Date:March 15 2011 4:56am
Subject:Unexpected Select Output
View as plain text  
Dear all,

Today I shoot a query to know the size of tables in a particular 
database, but don't know why it prints only the output of only one 
table. Here is my query & output :

mysql> SELECT table_schema 'database',table_name 'Table', concat( round( 
sum( data_length + index_length ) / ( 1024*1024*1024) , 2 ) , 'G' ) 
sizeGB,concat( round( sum( data_length + index_length ) / ( 1024*1024) , 
2 ) , 'M' ) sizeMB,concat( round( sum( data_length + index_length ) / ( 
1024) , 2 ) , 'K' ) sizeKB FROM information_schema.TABLES WHERE 
table_name ='hc_categories' or table_name='hc_master' or 
table_name='hc_web' and table_schema='pdc_crawler';
    -> ;
+-------------+---------------+--------+--------+--------+
| database    | Table         | sizeGB | sizeMB | sizeKB |
+-------------+---------------+--------+--------+--------+
| pdc_crawler | hc_categories | 0.00G  | 0.06M  | 58.71K |
+-------------+---------------+--------+--------+--------+


Why it is not able to print all table that fits in OR condition.


Thanks & best Regards,

Adarsh Sharma
Thread
Unexpected Select OutputAdarsh Sharma15 Mar
  • Re: Unexpected Select OutputJohan De Meersman15 Mar
Re: Unexpected Select OutputJohan De Meersman15 Mar