in reply to SQL Select

Can you do a "GROUP BY" in SQL, to get uniqueness ?

Also, append to the "WHERE" clause to filter out parts you do not want to scan.

If all you are doing is counting, SQL can again do that efficiently:

SELECT count(*) as nbr_of_parts_with_leading_zeros FROM table WHERE part like '0000000%';

        ...The words of the Prophets are written on the Facebook wall.

Replies are listed 'Best First'.
Re^2: SQL Select
by Scully4Ever (Novice) on Feb 03, 2016 at 23:28 UTC

    I have two groups of parts, one with valid part numbers and one that contains zeros. In the case with valid part numbers I need a unique count using the part numbers. In the case where they contain zeros I need to use the 'n' value and count how many unique 'n' values I have.