Skip to content

Simple Query – what’s wrong with it?

I’m trying to answer exercise 2 with the above (try it yourself here: https://sqlbolt.com/lesson/select_queries_with_nulls), but it’s not returning anything. Is it a problem with the site or my query? Thanks! Answer I checked your query, according to the question that was on the site, you can easi…

Left outer join not showing unmatched pairs Oracle SQL

I have a table like this, let’s call it main location item price l1 item1 3.00 l1 item2 1.00 l2 item1 3.00 l2 item2 1.50 l2 item3 2.00 l3 item4 5.00 l3 item5 5.00 and a separate table, call it items items item 1 item 2 item 3 item 5 item 4 item 5 item 6 and am currently trying

EF Core transaction lifetime

We are using our select statement inside transaction scope because of concurrency concerns. The question is, if I put my transaction in using statement, do I still have to call Commit() method explicitly to be sure that the transaction is closed or Dispose() method will do the job? Here’s example code: …

SQL query to get / delimited column value in single row

I have this output: Table 1 Requisition_number per_id per_name Job_title Interview TAS_EMAIL_ADDRESS TAS_FNAME 22021 1097 Chad Manager This is a comment abc.g@gmail.COM abc 22021 1097 Chad Manager This is a comment xyz.g@gmail.COM xyz I want the output to look like this: Requisition_number per_id per_name Job…

Consolidate Rows with SQL

Trying to consolidate test results so that each test is in one row. Database I am pulling from has an answer result per row. Sample Data: Student Name Test Name Question Attempt Answered Correctly (0 = no, 1= yes) Mary Intro Assessment 1 1 Mary Intro Assessment 1 0 Mary Intro Assessment 1 1 Joseph Intro Asses…

SQL Inner join with sum and null value

The table below is an extract of a larger set of data In my scenario Column 2 is null when is the “parent” record (Column 1 = AB1 and Column 2 is NULL) and as you can see the following 2 “child” records under Column 2 have AB1 as identifier which matches the AB1 from Column 1, what I w…

SQL Group Multiple Results from Single Table

I have a table that contains a line entry for each item that I need to group into an output with all the values of multiple rows that have the same uniqueID into one column result. The ItemType will be different but the UniqueID and OtherData shouldn’t change as it’s tied directly to the UniqueID,…