Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: SQL Select

by NetWallah (Canon)
on Feb 03, 2016 at 22:15 UTC ( [id://1154360]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1154360]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-20 01:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found