Solved

sql command to list blank mysql

Posted on 2009-03-30
4
441 Views
Last Modified: 2012-05-06
The code below is  list duplicate  blank  is 197 see picture how can I write sql commmand to list all record that 'code ' is blank  

remark code is can not be null
SELECT COUNT( * ) AS `Rows` , `Code`
FROM `customer`
GROUP BY `Code`
ORDER BY `Code`
LIMIT 0 , 30

Open in new window

197.JPG
0
Comment
Question by:teera
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
oobayly earned 200 total points
ID: 24017336
If I'm understanding correctly, you just want to list records where Code is an empty string
SELECT * FROM `customer` WHERE `Code` = '';
 
-- or if Code is counted as empty even if it contains spaces:
SELECT * FROM `customer` WHERE TRIM(`Code`) = '';

Open in new window

0
 
LVL 8

Assisted Solution

by:vinurajr
vinurajr earned 150 total points
ID: 24017397
SELECT COUNT( * ) AS `Rows` , coallsec(`Code`,'') AS `Code`
FROM `customer`
GROUP BY coallsec(`Code`,'')
ORDER BY `Code`
LIMIT 0 , 30
0
 
LVL 14

Assisted Solution

by:racek
racek earned 150 total points
ID: 24017660
SELECT * FROM `customer`
WHERE TRIM(`Code`) = ''
OR code IS NULL;
0
 
LVL 14

Expert Comment

by:racek
ID: 24017664
SELECT * FROM `customer`
WHERE TRIM(`Code`) = ''
OR Code IS NULL;
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

776 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