
- 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 number values be used as arguments in MySQL STRCMP() function?
For the purpose of comparison, we can use number values as an argument in STRCMP() function. They are given as arguments without quotes. Following example will demonstrate it.
Example
mysql> Select STRCMP(10,10)As 'Equal Numbers', STRCMP(11,10)AS '2nd Smaller', STRCMP(10,11)AS '1st Smaller', STRCMP(10,NULL)As '2nd NULL',STRCMP(NULL,10)AS '1st NULL',STRCMP(NULL,NULL)AS 'Both NULL'; +---------------+-------------+-------------+----------+----------+-----------+ | Equal Numbers | 2nd Smaller | 1st Smaller | 2nd NULL | 1st NULL | Both NULL | +---------------+-------------+-------------+----------+----------+-----------+ | 0 | 1 | -1 | NULL | NULL | NULL | +---------------+-------------+-------------+----------+----------+-----------+ 1 row in set (0.00 sec)
- Related Questions & Answers
- How can column data values of a table be compared using MySQL STRCMP() function?
- What is MySQL STRCMP() function and what would be the output of this function?
- What happens if I will use integer values as arguments of MySQL LOCATE() function?
- strcmp() function in PHP
- How Groups function can be used in MySQL SELECT clause?
- How to pass arrays as function arguments in JavaScript?
- How LOCATE() function can be used with MySQL WHERE clause?
- How can CONCAT() function be used with MySQL WHERE clause?
- How wildcard characters can be used with MySQL CONCAT() function?
- How can CONCAT_WS() function be used with MySQL WHERE clause?
- How can MySQL REPLACE() function be used with WHERE clause?
- How can MySQL COALESCE() function be used with MySQL SUM() function to customize the output?
- Which MySQL function can be used to append values of a column with single quotes?
- How to select multiple max values which would be duplicate values as well in MYSQL?
- How can MySQL SUBSTRING() function be used with FROM and FOR keywords?
Advertisements