hello.. i have a table name paintshop and have 4 fields
for example

table:paintshop
bodyNo | defect_code | qty | date
58786859 | FM | 9 | 2011-11-29
58786859 | BB | 1 | 2011-11-29
58786859 | TN | 4 | 2011-11-29
58786860 | RN | 7 | 2011-11-29
58786851 | LM | 9 | 2011-11-29

I want to count the bodyNo only for 2011-11-29 and display the numbers of bodyNo = 3 ( do not count the repeating bodyNo)

Recommended Answers

All 2 Replies

SELECT count(DISTINCT bodyNo) FROM paintshop WHERE `date`='2011-11-29'
SELECT count(DISTINCT bodyNo) FROM paintshop WHERE `date`='2011-11-29'

dear Hearth, thanks you very much for ur helps...:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.