Skip to content
DbaFix
Just share answer and question for fixing database problem
MENU
  • HOME

Tag: self-join

How to optimize selection of pairs from one column of the table (self-join)?

By adminPosted on February 1, 2023

Question : I’m using PostgreSQL 9.5.19, DBeaver 6.3.4 I have a table where one row is – user’s name, place […]

accelerating a SQL quadruple self-join with a complex alternation in the WHERE clause

By adminPosted on January 30, 2023

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

By adminPosted on January 18, 2023

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?

By adminPosted on December 4, 2022

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?

By adminPosted on November 3, 2022

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

By adminPosted on October 22, 2022

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

By adminPosted on August 29, 2022

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

By adminPosted on August 9, 2022

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

By adminPosted on August 1, 2022

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`?

By adminPosted on June 20, 2022

Question : This is tested with PostgreSQL 9.6, but it’s a general SQL question. Is it possible to use self-joins […]

  • 1
  • 2
  • 3
  • 4

Recent Posts

  • Update statement errors, parenthesis, failed validation ORACLE
  • postgresql grant user privilages to dynamically created tables
  • How can streaming replication be kept lagged by a certain ‘delay’ time?
  • Query for similar syllables on a field
  • Write filename, servername/IP and date+time in spool file
  • Designing a table with multiple null FKs
  • I am trying to get the string between hyphen (-) which is before (+) upto next colon (:)
  • Why would a SELECT INTO cause an arithmetic overflow?
  • Possibility to implement time to execute / TempDB usage restrictions on some role groups in SQL Server?
  • Login failed for user – Error 18456 – Severity 14, State 38
  • comparing two values in same column with another column using AND condition
  • Slow running aggregate of aggregate query
  • Is it possible to get seek based parallel plan for distinct/group by?
  • PostgreSQL replication: out-of-sequence timeline ID, when former master made slave
  • Autogrowth Analysis in PROD DB based on the trace file data
  • Single versus Multiple databases
  • Does a user who has permissions to select from a view also need select granted to the children entities of that view?
  • Parse a string to find data between delimiters, multiple occurrences
  • Oracle multiple databases on same server [closed]
  • Help to create indexes to improve query performance and reduce report generation time

Categories

  • Database Backup
  • Database Design
  • Database Index
  • Database Optimization
  • InnoDB
  • Join
  • MariaDB
  • MongoDB
  • MySQL
  • Oracle
  • Performance
  • Permissions
  • Postgresql
  • Query Performance
  • Replication
  • Security
  • SQL Server
Proudly powered by WordPress / Support by: DizzyCoding