mardi 19 juillet 2016

Counting Distinct Across Multiple Columns (Vertica SQL)

Checked other questions without getting a clear answer. I saw a simple answer using MySQL, but it doesn't work in Vertica. Is there an efficient way to count distinct in vertica SQL across multiple columns.

For example, I know in MySQL you can do something like this:

SELECT l.computer, l.user, COUNT(DISTINCT l.computer, l.user) AS count
FROM login l 
GROUP BY l.computer, l.user

Is there a similar syntax in vertica?

Thanks, Ben

Aucun commentaire:

Enregistrer un commentaire