Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
436 views

Join result of crosstab to main query

I'm trying to get this column structure: | id | name | main_image | rating | shop_names | prices | urls | 2 | 3 | My table structure looks like this CREATE TABLE products ( id SERIAL PRIMARY KEY, ...
broken_cursor's user avatar
-1 votes
1 answer
2k views

Write a dynamic query of nested subqueries [duplicate]

Let's take an everyday query with a list of nested queries so I can show you the problem, see how we'd have to add a subquery when a new Certification comes out: select DISTINCT e.display_name as &...
Jeremy Thompson's user avatar
0 votes
1 answer
186 views

How to split a SUM column based on another BIT column? [duplicate]

MySQL v5.7 Having this table: id | sprId | load | calc -----|----------|---------|--------- 1 | 1 | 1 | 7 2 | 2 | 1 | 1 3 | 2 | 1 | ...
Shin's user avatar
  • 115
1 vote
1 answer
3k views

Converting rows to columns using crosstab in PostgreSQL not working (relation "table" does not exist)

I need to use the compiled data using CTE and then convert the columns to rows using crosstab(open to other ideas) in the next select statement. Below is the query. with checked_adgroup AS ( ...
Ansar Mohiuddin Mohammed's user avatar
0 votes
2 answers
65 views

How to join these queries?

So I currently have this query: SELECT v.Voorstellingsnummer, COUNT(r.Voorstellingsnummer) FROM reserveringen r, voorstelling v WHERE r.Voorstellingsnummer = v.Voorstellingsnummer GROUP BY r....
Yvalson Dronkers's user avatar
2 votes
1 answer
962 views

Select query for returning different data based on creation time

I have a view, which will select data from table reports. The select will filter the data based on multiple dates. reports table: id, key_id, position, created_at My select: pr.key_id, COALESCE(...
RockNinja's user avatar
  • 683