এজন্য REPLACE() ফাংশন ব্যবহার করে খালি স্পেস ক্যারেক্টারের সাথে রিপ্লেস করুন।
টেবিল তৈরি করা
mysql> create table DemoTable (Subject text); Query OK, 0 rows affected (0.86 sec)
রেকর্ড ইনসার্ট করা
mysql> insert into DemoTable values('Introduction to MySQL');
Query OK, 1 row affected (0.15 sec)
mysql> insert into DemoTable values('Java in depth');
Query OK, 1 row affected (0.21 sec)
mysql> insert into DemoTable values('Data Structure and Algorithm');
Query OK, 1 row affected (0.16 sec)
সকল রেকর্ড প্রদর্শন
mysql> select *from DemoTable;
আউটপুট
+------------------------------+ | Subject | +------------------------------+ | Introduction to MySQL | | Java in depth | | Data Structure and Algorithm | +------------------------------+ 3 rows in set (0.00 sec)
খালি স্পেস রিপ্লেস করার কোয়েরি
mysql> SELECT *,REPLACE(Subject,' ','_') as Subject_Name from DemoTable;
আউটপুট
+-------------------------------+------------------------------+ | Subject | Subject_Name | +-------------------------------+------------------------------+ | Introduction to MySQL | Introduction_to_MySQL | | Java in depth | Java_in_depth | | Data Structure and Algorithm | Data_Structure_and_Algorithm | +-------------------------------+------------------------------+ 3 rows in set (0.00 sec)