Solved

sql command to list blank mysql

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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to use md5 hashing 3 29
Hacked File Timestamps 4 50
Split long text string into shorter chunks 7 23
How to count in a table in php 22 19
Creating and Managing Databases with phpMyAdmin in cPanel.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
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.
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 …

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now