Skip to content

Tag: distinct

Can repeating query be saved?

In my Python / Sqlite program, I am running queries like this So the “basic” query is the same, and the rows Sqlite gathers are the same, but because of the different grouping , I have to run the same query multiple times. I wonder if there is a way to achieve the same output more effectively, ie. run the

Pandas ‘count(distinct)’ equivalent

I am using Pandas as a database substitute as I have multiple databases (Oracle, SQL Server, etc.), and I am unable to make a sequence of commands to a SQL equivalent. I have a table loaded in a DataFrame with some columns: In SQL, to count the amount of different clients per year would be: And the result would be How