- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 4219 Articles for MySQLi
![Kumar Varma](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
405 Views
Let us first create a table −mysql> create table DemoTable -> ( -> Name varchar(100), -> DueDate datetime -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command. Let’s say the current date is “2019-07-03” −mysql> insert into DemoTable values('Chris', '2019-06-24'); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values('Chris', '2018-01-01'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('Robert', '2019-07-03'); Query OK, 1 row affected (0.21 sec) mysql> insert into DemoTable values('Carol', '2019-08-03'); Query OK, 1 row affected (0.22 ... Read More
![Rama Giri](https://www.tutorialspoint.com/assets/profiles/13881/profile/60_68188-1512710896.jpg)
392 Views
Let us first create a table −mysql> create table DemoTable -> ( -> value int -> ); Query OK, 0 rows affected (0.82 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable values(100); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable values(20); Query OK, 1 row affected (0.28 sec) mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.34 sec) mysql> insert into DemoTable values(30); Query OK, 1 row affected (0.24 sec) ... Read More
![Kumar Varma](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
2K+ Views
To create a temporary table in a MySQL procedure, following is the syntax −CREATE PROCEDURE yourProcedureName() BEGIN CREATE TEMPORARY TABLE yourTemporaryTableName SELECT yourValue; ENDLet us implement the above syntax to create a temporary table and insert some records in the table. Following is the query to create a stored procedure and a temporary table in it −mysql> DELIMITER // mysql> CREATE PROCEDURE create_Temporary_Table() -> BEGIN -> CREATE TEMPORARY TABLE tmpDemoTable SELECT 500; -> END// Query OK, 0 rows affected (0.15 sec)Following is the query to insert record in the table −mysql> ... Read More
![Rama Giri](https://www.tutorialspoint.com/assets/profiles/13881/profile/60_68188-1512710896.jpg)
159 Views
Let us first create a table −mysql> create table DemoTable -> ( -> EmployeeName varchar(100) -> ); Query OK, 0 rows affected (0.81 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Adam Smith'); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values('Carol Taylor'); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values('David Miller'); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable values('Chris Evan'); Query OK, 1 row affected (0.13 sec)Display all records from the table using select statement −mysql> select ... Read More
![Kumar Varma](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
170 Views
To get the character length, use the CHAR_LENGTH() method. Let us first create a table −mysql> create table DemoTable -> ( -> Name varchar(100) -> ); Query OK, 0 rows affected (1.04 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('John'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('Robert'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values('Bob'); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable values('David'); Query OK, 1 row affected (0.15 sec)Display all records from the table ... Read More
![Rama Giri](https://www.tutorialspoint.com/assets/profiles/13881/profile/60_68188-1512710896.jpg)
266 Views
Let us first create a table −mysql> create table DemoTable -> ( -> FirstName varchar(100) -> ); Query OK, 0 rows affected (0.53 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('John'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('Adam'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable values('Sam'); Query OK, 1 row affected (0.22 sec) mysql> insert into DemoTable values('Johnny'); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable values('Joy'); Query OK, 1 row affected (0.12 sec) ... Read More
![Kumar Varma](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
2K+ Views
You can use format specifier. Following is the syntax −select str_to_date(yourColumnName, '%d/%m/%Y %h:%i %p') as anyAliasName from yourTableName;Let us first create a table −mysql> create table DemoTable -> ( -> DueDate varchar(100) -> ); Query OK, 0 rows affected (0.51 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('11/02/2019 10:35'); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable values('21/12/2018 12:01'); Query OK, 1 row affected (0.19 sec)Display all records from the table using select statement −mysql> select *from DemoTable;OutputThis will produce the following output −+------------------+ | DueDate ... Read More
![Kumar Varma](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
747 Views
For this, you can use REGEXP. Let us first create a table −mysql> create table DemoTable -> ( -> ClientCode varchar(100) -> ); Query OK, 0 rows affected (0.56 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Chris902'); Query OK, 1 row affected (0.21 sec) mysql> insert into DemoTable values('Robert_'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values('903'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable values('123_David'); Query OK, 1 row affected (0.21 sec)Display all records from the table using select statement ... Read More
![Rama Giri](https://www.tutorialspoint.com/assets/profiles/13881/profile/60_68188-1512710896.jpg)
484 Views
For exact case sensitive match, use BINARY after WHERE clause in MySQL. Let us first create a table −mysql> create table DemoTable -> ( -> EmployeeCode varchar(100) -> ); Query OK, 0 rows affected (0.64 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('EMP-1122'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('emp-1122'); Query OK, 1 row affected (0.43 sec) mysql> insert into DemoTable values('EMP-6756'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable values('EMP-8775'); Query OK, 1 row affected (0.16 sec)Display all records ... Read More
![Kumar Varma](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
997 Views
Yes, we can do this by first using CAST(). Let us first create a table −mysql> create table DemoTable -> ( -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> StudentScore varchar(100) -> ); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(StudentScore) values('90'); Query OK, 1 row affected (0.21 sec) mysql> insert into DemoTable(StudentScore) values('100'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable(StudentScore) values('56'); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable(StudentScore) values('98'); Query OK, 1 ... Read More