Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

sql command to list blank mysql

Posted on 2009-03-30
4
Medium Priority
?
449 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 800 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 600 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 600 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

660 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