i’ve a sheet like this: Month(Col11) Team (Col2) 03 luna 03 luna 04 pippo 04 gigi 04 luna 04 gigi 04 pippo 04 luna 04 luna 04 pippo 04 pippo 04 grisbi 04 grisbi 05 luna 05 luna 05 pippo 05 pippo 05 grisbi 05 grisbi i need the sum of unique of each month, a result like this: Month(Col11)
Tag: sql
Optional variable in Graphql
I have a graphql query like this: when i run this it expects a id as variable. How can I make that variable optional? It should display all results when no id is given Answer There’s no way that I’m aware to declare a variable as optional but also have it ignore the rest of the expression in the way
SQL Command isnt running (invalid identifier) maybe SYSDATE?
I’m having a bit of trouble getting my command to run and I think that it has something to do with the SYSDATE command: I get the ORA-00904: : invalid identifier error. Any fix? Answer The problem is the last field definition: Get rid of the comma and you’ll be fine. db<>fiddle here
How to show multiple tables list in MySql
How to show multiple table list in mysql I have a query that has two tables one for patients and the second one for patients who has tested for covid-19 I want to show all the patients either they tested or not If tested then show the result with his/her name It only showing the patients who has tested for
What is wrong with my implementation of this method to calculate a person’s age?
I want to calculate age using the method suggested here, format the date to yyyymmdd and subtract the date of birth (also yyyymmdd) from the current date then drop the last 4 digits you’ve got the age I tried this. But it returns me the same number 20210428 Answer You’re very close, but there’s some precedence problems and you’re dividing
Joining two tables on multiple columns and subtracting the value field
I have two tables, Table_A and Table_B both having the same number of columns and structure, without having any unique key in any of them. They have one single value field. I would like to subtract …
How to specify a limit on Postgres json_agg
I want a JSON output having the distinct values of a column and also a limited number of rows. This is the sample table that I have in a Postgres Database: Name Author Copies Sold —- …
Aggregating data in BigQuery by month
I feel silly asking this because it seems simple, but I concede and need some help. In BigQuery I have a Table that looks like this: Date Portfolio Super_Discipline Dollars Units 2020-05-20 …
SQL Subquery within a subquery [closed]
I am writing a nested SQL where I need to have a subquery within a subquery Let’s say I am trying to retrieve a row from ORDERS that matches MAIN_ID from SOURCE that matches MODULE from MODULES. …
Python/SQL/pydobc: Get result of if operation for counter?
I’m running the following code to add emails to a database table if they do not already exist. I’d like to be able to count the emails that are added and the ones that already existed. I’ve tried checking the cursor.description after each loop, but it returns None whether the item existed or not. Is there a way to do