Solved

sql command to list blank mysql

Posted on 2009-03-30
4
446 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MySQL 5.6.30 - daily outages 46 61
Add a loading gif while php runs server side 15 66
php subtract from date 2 28
How to hide contact form only if no validation errors 4 24
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

756 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