SELECT table_name, table_rows,
IF(Index_length=0, Data_length, Data_length*Index_length) AS 'Table Size'
FROM information_schema.tables
WHERE table_schema='mk'
ORDER BY 'Table Size', table_rows DESC;
1. mk 是資料庫名
2. IF是判斷式,如果Index_length是0
沒有留言:
張貼留言