Solved

sql command to list blank mysql

Posted on 2009-03-30
4
448 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

626 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