I have two tables, one with some user configurations (#USERCONFIG) and the other (#COMBINATIONS), multiples combinations of configurations I need to find in the first table. With this example data, I want the resultset to look like this: Where it will return all users that have a match of configurations from the combinations table. Any help would be appreciated. Answer
Tag: relational-division
How can I apply mutliple filters on my sql tables
I am struggling with what looks to be relational division in sql. I need to filter data from the same table based on multiple criteria. Here-under is a schema of what my table looks like. | ——-|–…
jsonb query with nested objects in an array
I’m using PostgreSQL 9.4 with a table teams containing a jsonb column named json. I am looking for a query where I can get all teams which have the Players 3, 4 and 7 in their array of players. The table contains two rows with the following json data: First row: second row: How does the query have to look
How to return rows that have the same column values in MySql
Lets consider the following table- I am a total SQL noob but how do I return the Scores featuring both IDs 2 and 4? So it should return 100 since its featured in both ID 2 and 4 Answer This is an example of a “sets-within-sets” query. I recommend aggregation with the having clause, because it is the most flexible
Transpose table with “list” of the same attributes
Is it possible to transpose a table with repeated columns? Existing table: user_id question_id body 1 1 ‘Text1 1’ 1 1 ‘Text1 1-2’ 1 2 …
Can all SQL queries be represented in Relational Algebra, Domain and Tuple relational calculus
My query includes a having and count or all in. How are these represented in RA/DRC/TRC? Would I have to simplify my SQL query even more? Here is a simplified example: empl(employee (primary key), …