Skip to content
Advertisement

Tag: join

Left Join – attempting to identify instances where child records do not exist, or if they do exist, populate unique records meeting specific criteria

I am attempting to search an SQL database for instances where child records do not exist, or if they do exist, they are a specific type (e.g. Historical) and no other types exist (e.g. Current): This populates all of my parent records that do not have any child records without any issues. However, I also want the query to populate

COUNT Multiple Columns using GROUP BY – SQL

I am trying to create a GROUP BY COUNT of ~30 columns in my database. The database is basically a shiftplan, where on each column a row can be assigned different shift types (denoted as a D, N, A, X, F, C, etc..). I can use the following query to get a count of each shift type, am struggling to

ORA-01417: a table may be outer joined to at most one other table

I have this query below for oracle sql: When i execute it, i got ORA-01417: a table may be outer joined to at most one other table. Need help for this error. Answer Please use below query. In the current query, your aggregation is incorrect, you have to use same function as you use in the select query. And changed

How to joins in oracle based on condition

I have two tables as below: Table Apple: Table KEEY: Desired Output: Code Tried So far: This is giving me : I guess i need to use pivot instead of Union to get both the ids on same row. Have you ever encountered such scenarios? Any pointers to proceed will be very helpful. Thanks in Advance! DDL used for the

Filter country using a JOIN in BigQuery

In a scheduled query in BQ, I am trying to filter countries using an external Google Sheet (already made a table). The query already has a join from two other tables. I would like to enter a SELECT clause in the WHERE statement. I keep getting errors. Any tips as to where I am going wrong? Expected output would be

Advertisement