LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

mysql distinct search for one column

Solved!
Go to solution

I would like to use an SQL query to return from a database the first occurence of a data value (DUT's serial number). I have a database that contains the DUT serial number, the test status (i.e. pass or fail), and the date the DUT was tested. Since I am trying to determine the first pass yield for this test lot of DUTs, I want to only query the database for the first occurence (i.e. earliest date DUT was tested), and retunr the test status for this entry. Any recommendations on what type of SQL commadn I could use to get this data?

Below is an example of the database:

DUT SN         TEST STATUS             DATE TESTED

001                Failed                          6-1-2011

001                Passed                        6-2-2011

002                Passed                        6-1-2011

003                Passed                        6-1-2011

004                Failed                          6-2-2011

004                Passed                        6-2-2011

005                Passed                        6-2-2011

 

THis is the data I would like to extract:

DUT SN         TEST STATUS             DATE TESTED

001                Failed                          6-1-2011

002                Passed                        6-1-2011

003                Passed                        6-1-2011

004                Failed                          6-2-2011

005                Passed                        6-2-2011

 

As you can see I only want to get the first entry for a serial number. This first entry will be used to determine the first pass yield for the lot of boards.

 

Thank you in advance for your time and assistance,

Jim

0 Kudos
Message 1 of 6
(3,569 Views)

I don't believe you can do one query to get what you want.  I use this query:

M3K DMS Data_BD.png

 

... and then process the results like this:

Get SNs from Results_BD.png

 

...to get first-pass yield information.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 6
(3,549 Views)

Hi Jim,

 

Thank you for the response. I am looking at your solution but I am having a difficult time trying to identify the VI you are using to get the distinct serial number (the Vi with the (1) underneath it in your diagram). Can you tell me the name of this VI? I am using LV 2010 if that makes any difference.

 

Thank you,

Jim

0 Kudos
Message 3 of 6
(3,542 Views)

All of the green functions are OpenG VIs.  The first one is Remove Duplicates From1D Array.  They're all from the array pallet:

 

 

Here's how to get them.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 4 of 6
(3,540 Views)

Thanks Jim! I installed the OpenG library and give this a go later today. I'll let you know how I make it.

 

Thanks again,

Jim

0 Kudos
Message 5 of 6
(3,536 Views)
Solution
Accepted by topic author GeekGrok

Hi Jim,

 

Looks like your solution worked. Thank you very much for providing this information.

 

Best Regards,

Jim

Message 6 of 6
(3,514 Views)