Compare value of phone2
with empty string:
select phone, phone2
from jewishyellow.users
where phone like '813%' and phone2<>''
Note that NULL
value is interpreted as false
.
More Related Contents:
- MySQL Insert query doesn’t work with WHERE clause
- Delete from two tables in one query
- Why would an IN condition be slower than “=” in sql?
- PostgreSQL GROUP BY different from MySQL?
- GROUP BY behavior when no aggregate functions are present in the SELECT clause
- Fulltext Search with InnoDB
- MySQL dump by query
- MySQL’s now() +1 day
- Delete sql rows where IDs do not have a match from another table
- Rewriting mysql select to reduce time and writing tmp to disk
- How do I convert from BLOB to TEXT in MySQL?
- Can you access the auto increment value in MySQL within one statement?
- Which SQL query is better, MATCH AGAINST or LIKE?
- What does DELIMITER // do in a Trigger?
- Mysql: how to select groups having certain values?
- How to create a multi-tenant database with shared table structures?
- MySQL #1140 – Mixing of GROUP columns
- Boolean vs tinyint(1) for boolean values in MySQL
- MySQL full text search for words with three or less letters
- MySQL: “The SELECT would examine more than MAX_JOIN_SIZE rows”
- Function for week of the month in mysql
- MySQL’s alternative to T-SQL’s WITH TIES
- Find rows that have the same value on a column in MySQL
- what is the difference between GROUP BY and ORDER BY in sql
- What does collation mean?
- What’s the correct name for an “association table” (a many-to-many relationship) [closed]
- sql pulling a row for next or previous row of a current row
- Row Rank in a MySQL View
- Select Rows with Maximum Column Value group by Another Column
- mysql GROUP_CONCAT duplicates