kformeck
kformeck

Reputation: 1823

MySql distinct results of a set of distinct results

I have a table that usually contains around 37,000 rows. The table provides all of the data for one wafer. One row contains data for one device on the wafer. We separate everything into 8 different sections, called tapes. I would like to be able to get the distinct number of device types on each distinct section of the wafer. So the first column would be called called "tape", the second column would be called "mask" and the third column would be called "count". The count column contains the number of each distinct mask type found on each distinct tape.

I am unsure of how to create a query to query this data. Any help would be really appreciated.

Upvotes: 0

Views: 43

Answers (2)

prava
prava

Reputation: 3986

yes, GROUP BY clause will help you.

Upvotes: 0

kformeck
kformeck

Reputation: 1823

I just talked to my office mate and he gave a me solution that seems to be working reliably. Here is what he came up with:

    SELECT tape, mask, count(*)
    FROM wafer_name_table
    GROUP BY tape, mask;

Upvotes: 0

Related Questions