I have this table state num ------------------------- ca 20 ny 30 ca 50 ca 10 ny 70 ny 90 What I want is to p
I have the simplified version of the table I have below. Each row has an item_order value partitioned by its parent_id. item_id item_name parent_id item_order
Does any one know how to create crosstab queries in PostgreSQL? For example I have the following table: Section Status Count A Active 1 A
I tried to make software that could be use as a database for libraries so I started to learn SQL I alredy did way to save a book into the database but I am stuc
I have following query to handle null value and flag those based on two table join however c.pure_proc_flag is null then 0 else 1 does not provide the result
I have a dynamic table in the format shown in the image (left hand side). A new month column will be added every month. How do I unpivot month in Presto? I can
I need to create a table where we have one date column. I need to insert the date from yesterday to yesterday-30 days.Table output should look like this There
Getting this error when using Get Data with PowerBI Desktop to connect to SQL database Microsoft SQL: The ORDER BY clause is invalid in views, inline functions,
I want to query records from the access database that matches the current date (system date) The following query works fine if I enter the date literally. SELEC
To illustrate with an example, say I have two tables in BigQuery called "fruits" and "vegetables" respectively. I want to have a variable at the start that lets
I am trying to retrieve IDs from a table in Sybase ASE 16.0 The query has to return IDs starting with AB or BC. Example AB0001 AB0002 BC0001 BC0002 The regular
I have a trigger which declares a table variable. DECLARE @TREarn_aaa table ( aaaID bigint NOT NULL PRIMARY KEY, Bbb decimal (18, 8) NULL, Ccc dec
I'm trying to find a way to filter by the attribute of the first row returned as children. class Parent(Base): __tablename__ = "parent_table" id = Colum
I have two tables, CITIES and FLIGHTS: CITIES id name 1 New York 2 Paris 3 Tokyo 4 Amsterdam FLIGHTS id departure_id arrival_id 1 1 2 2 1 3 3 2 3 4 2 4 I ne
referring to this question: Finding duplicate values in multiple colums in a SQL table and count I have the following table structure: id name1 name2 name3 ...
My SQL Server table looks like this ID a_Toyota a_Mazda a_Nissan a_Kia a_Honda a_Subaru SoldCar CarOrder 1 8000 7000 6200
I would like to do a PIVOT on my table but I don't have aggregation column. SELECT CONVERT(date, DataHora) AS dia, CONVERT(VARCHAR(5), DataHora, 108) A
I have a table of students and classes. I would like to find what classes were dropped from one semester to another (and a similar query for classes added). Stu
I am struggling with the problem with nesting root for every day (it's an element of my table). I'd like to get nested Key: value pair of day from table Day. He
I have two data tables. They both have an employee id column and a sales quarter column, in addition to lots of other columns. The first, which ill call "Rost