- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
How can we use BIN() function with MySQL WHERE clause?
When BIN() string function is used with WHERE clause, the output returns by it will depend upon the condition given in WHERE clause. In this case, we must have to use binary value in WHERE clause. For example, suppose we have a table named ‘Student’ and we want to get only those rows where the binary value of column ‘id’ is higher than 1010, then we can write following query −
mysql> Select *,Bin(id) from student where BIN(id) > 1010 ; +------+---------+---------+-----------+---------+ | Id | Name | Address | Subject | Bin(id) | +------+---------+---------+-----------+---------+ | 15 | Harshit | Delhi | Commerce | 1111 | | 20 | Gaurav | Jaipur | Computers | 10100 | +------+---------+---------+-----------+---------+ 2 rows in set (0.00 sec)
- Related Articles
- How can we use ASCII() function with MySQL WHERE clause?
- How can we use CHAR_LENGTH() function with MySQL WHERE clause?
- How can we use FIND_IN_SET() function with MySQL WHERE clause?
- How can we use MySQL INSTR() function with WHERE clause?
- How Can we use MySQL DISTINCT clause with WHERE and LIMIT clause?
- How can we use two columns with MySQL WHERE clause?
- How can I use SPACE() function with MySQL WHERE clause?
- How can we use MySQL REVERSE() function on column’s data along with WHERE clause?
- How can we use WHERE clause with MySQL INSERT INTO command?
- How can we use MySQL SUM() function with HAVING clause?
- Can we use the result of a SUM() function in MySQL WHERE clause
- Can we use WHERE clause inside MySQL CASE statement?
- How can MySQL REPLACE() function be used with WHERE clause?
- How can CONCAT() function be used with MySQL WHERE clause?
- How can CONCAT_WS() function be used with MySQL WHERE clause?

Advertisements