
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to add separator to numbers using MySQL views?
Let us first create a table −
mysql> create table DemoTable ( StudentId int ); Query OK, 0 rows affected (0.62 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values(343898456); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable values(222333444); Query OK, 1 row affected (0.22 sec)
Following is the query to display all records from the table using select statement −
mysql> select *from DemoTable;
This will produce the following output −
+-----------+ | StudentId | +-----------+ | 343898456 | | 222333444 | +-----------+ 2 rows in set (0.00 sec)
Here is the query to create view −
mysql> create view myView_DemoTable as select format(StudentId, 0) AS `StudentId` from DemoTable; Query OK, 0 rows affected (0.18 sec) Let us check the records of view table: mysql> select *from myView_DemoTable;
This will produce the following output −
+-------------+ | StudentId | +-------------+ | 343,898,456 | | 222,333,444 | +-------------+ 2 rows in set (0.04 sec)
- Related Questions & Answers
- MySQL group_concat to add a separator for empty fields?
- How to add a separator to a Menu in JavaFX?
- How to add binary numbers using Python?
- How to add separator in a ToolBar with Java?
- How to Dynamically Add Views into View in Android?
- How to create a separator using JavaFX?
- How to add a separator in Menu item in Tkinter?
- How to add/subtract large numbers using Python?
- How to get a list of MySQL views?
- How to update a value with substring of current value by removing the separator and numbers after a separator in MySQL?
- How to add a separator for a choice box in JavaFX?
- How to place a thousand separator in MySQL records?
- How can we create MySQL views?
- How to style the separator using CSS in JavaFX?
- How to add column using alter in MySQL?
Advertisements