Solved

MySQL: Not empty

Posted on 2011-03-10
2
381 Views
Last Modified: 2012-05-11
How can I specify where a table is not empty?  

A table is empty if it is null or if it contains nothing or if it only contains whitespace.
SELECT * FROM `abc` WHERE `xyz` NOT EMPTY

Open in new window

0
Comment
Question by:hankknight
2 Comments
 
LVL 24

Accepted Solution

by:
jimyX earned 500 total points
ID: 35098567
SELECT * FROM `abc` WHERE (select count(*) from `xyz`) > 0
0
 
LVL 16

Author Comment

by:hankknight
ID: 35210308
I found that this also works:
SELECT * FROM `abc` WHERE length(xyz)>0

Open in new window

0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
join tables 4 55
PHP - AJAX and MySQL it works only if the value is a number 12 57
insert into database through form with dynamic fields. 2 31
MySQL Query Using Up Memory 6 32
All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question