Question : I’m using PostgreSQL 9.5.19, DBeaver 6.3.4 I have a table where one row is – user’s name, place […]
Tag: self-join
accelerating a SQL quadruple self-join with a complex alternation in the WHERE clause
Question : The following Sqlite query has a triple self-join on table t: SELECT “update_variable”, lhs_acc.name_suffix || “:” || rhs_var.name_suffix, […]
MySQL Indexes on all column combinations
Question : I have a table that basically represents the log of records CREATE TABLE records ( id varchar(36), — […]
Many-to-many tag filter query with a junction table get slower with more tags. Can it be faster?
Question : Part 1 I have this query to find some videos containing all given tags. Here with tags 1,9,27,13,67 […]
MariaDB: Why is this still using temporary and filesort – is it because I’m using a self-join? How to fix?
Question : SELECT e2.personId, COUNT(*) FROM entries e1 JOIN entries e2 ON e2.categoryId = e1.categoryId AND e2.personId != e1.personId WHERE […]
Multiple self joins where joining condition not always exists
Question : I am trying to perform a multiple self join query where one of the conditions it is joining […]
MySQL Indexes on all column combinations
Question : I have a table that basically represents the log of records CREATE TABLE records ( id varchar(36), — […]
Looking for help reporting duplicates and null marks
Question : Someone over at StackOverflow suggested this might be the place to ask this. I hope this will question […]
Group by unknown ID, select all related rows where Column X = Y and Column X = Z
Question : I have a table that logs interactions from users with the following structure. SELECT [SessionID] ,[Question] ,[Response] ,[DateCreated] […]
self-joins in recursive CTE: `recursive reference must not appear more than once`?
Question : This is tested with PostgreSQL 9.6, but it’s a general SQL question. Is it possible to use self-joins […]