I would like to count the number of unique records not matching on 2 key variables from Data B compared to Data A and present the result as a percentage of the total unique records in Data B. Data A: …
Tag: join
How to join queries with a subquery?
So I’m a total newbie trying to solve this exercise where I have to find all the dishes that are marked as Vegetarian but contain Turkey meat in their ingredients. This is what I’ve tried (this is where I inner join 3 tables to find the ingredients): this is where I can’t seem to be able to join the subquery
Is this a perfect SQL query to fetch random items
I have this below query to fetch books of a random author and order by the books last modified date. Because I am new to SQL something tells me this query can be improved and simplified. I would appreciate the help of the SQL experts, if this is already simplified then I will consider myself an SQL expert :). Table
Subquery with joins – need help returning rows even if empty – MySQL
okay guys, this is a big one that’s confusing as hell. I’m creating a forum type dealio: I have an array of Topics and each topic has an array of Posts associated with the Topic. The Topics list page should show the latest Post from that specific Topic. (Each topic is in a category as well) Topic Latest post Check
SQL Join tables with no unique values
I am trying to create a table for a game that shows some player and team stats so I can compare them. The two tables look like this: year player team patch game result …
How can I get the division of two group by on SQL?
I’ve seen several posts to get the percentage of each row (using partition by), others about getting one row divided by another (using inner join with the same table), but I haven’t seem this problem, …
Join tables to display null if right side table doesnt have data
I have a feedback_ques, feedback_ans table as follows: I want to join the tables as follows: This gives me all the fields. I want the query to return null for answers if they arent found in the answers table. For example member_id 20 doesnt have answers, so i would want the table to display null values as below for this
(SQL) Pulling linked profiles from two tables using Knex
I currently have two tables with the following data: I currently have my query set up like this with Knex: I’m currently parsing the data into the following format: This works totally fine except for the cases where the parent has no children, as it won’t pull any data at all, including parent info. Is there any workaround in this
Postgres totals by classification per group
for example i have an orders table with a classification column. i want to get the total per classification for each city in a state for certain identified cities, for specific date. I have done the …
Trying to make a new table by pulling data from two tables and keep getting ‘Error: Every derived table must have its own alias’ on this query
I have an ‘Orders’ table and a ‘Records’ table. Orders table has the following columns: Records table has the following columns: I’m trying to pull and compile the following list of data but I keep getting an error message: Here’s my query: What am I doing wrong? Answer The subquery in the join needs an alias. It also needs to