Warning: Creating default object from empty value in /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4991

Warning: Creating default object from empty value in /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4993

Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php:4991) in /www/htdocs/v030397/mysql-qotd/wp-includes/feed-rss2-comments.php on line 8
Comments on: Question 42: How do you find the largest table? http://mysql-qotd.casperia.net/archives/312 mysql 5.0/5.1 questions for learning purposes Fri, 06 Aug 2010 16:56:36 +0000 http://wordpress.org/?v=abc hourly 1 By: plogi http://mysql-qotd.casperia.net/archives/312/comment-page-1#comment-48 plogi Mon, 17 May 2010 18:22:33 +0000 http://mysql-qotd.casperia.net/?p=312#comment-48 <b>   Here are some possibilities:   <pre> select * from information_schema.tables where table_rows= (select max(table_rows) from information_schema.tables); select * from information_schema.tables order by table_rows desc limit 1; select v1.* from information_schema.tables v1, (select max(table_rows) as mtr from information_schema.tables) v2 where v1.table_rows=v2.mtr; set @a=(select max(table_rows) from information_schema.tables); select * from information_schema.tables where table_rows=@a; </pre>   What kind of solutions did you find? </b>
 
Here are some possibilities:
 

select * from information_schema.tables
  where table_rows=
  (select max(table_rows) from information_schema.tables);

select * from information_schema.tables
  order by table_rows desc limit 1;

select v1.* from information_schema.tables v1,
  (select max(table_rows) as mtr from information_schema.tables) v2
  where v1.table_rows=v2.mtr;

set @a=(select max(table_rows) from information_schema.tables);
select * from information_schema.tables where table_rows=@a;

 

What kind of solutions did you find?

]]>