INFORMATION_SCHEMA.TABLES থেকে table_name প্রোপার্টি ব্যবহার করে ORDER BY ক্লজ দিয়ে টেবিল নাম অনুযায়ী সর্ট করা যায়। ASC বা DESC ব্যবহার করে অ্যাসেন্ডিং বা ডেসেন্ডিং অর্ডার করা সম্ভব। সিনট্যাক্স:
SELECT table_name FROM information_schema.tables WHERE table_type = 'BASE TABLE' AND table_schema='yourDatabaseName' ORDER BY table_name DESC;
‘sample’ ডেটাবেস ব্যবহার করে কিছু টেবিল থাকলে, প্রথমে সকল টেবিল দেখি:
mysql> show tables;
আউটপুট:
+--------------------------+ | Tables_in_sample | +--------------------------+ | blobsizedemo | | insert_prevent | | insertrecord_selecttable | | insertrecordprevent | | mytable | | newlinedemo | | notequaloperator | | sumofeverydistinct | | yourtable | +--------------------------+ 9 rows in set (0.00 sec)
এখন টেবিল নাম ডেসেন্ডিং অর্ডারে সর্ট করি:
mysql> SELECT table_name
-> FROM information_schema.tables
-> WHERE table_type = 'BASE TABLE' AND table_schema='sample'
-> ORDER BY table_name DESC;
ফলাফল:
+--------------------------+ | TABLE_NAME | +--------------------------+ | yourtable | | sumofeverydistinct | | notequaloperator | | newlinedemo | | mytable | | insertrecordprevent | | insertrecord_selecttable | | insert_prevent | | blobsizedemo | +--------------------------+ 9 rows in set (0.00 sec)