Skip to content

Tag: sql

SQL. full range of dates for every user

Please see code below. For every Underwriter that exists that is in a given month, I need every single date in the month and the given Underwriter. Thank you so much Original Table: Desired Output: Please note that Rebecca should not have dates for 12/1/2019 to 12/31/2019 Attempted Code Answer Use a Tally, th…

Show specific rows in SQL by not existing in another table

I’m not very experienced in advanced SQL and stackoverflow, so I’m trying my best to explain what I need. Let’s say I have a table called ‘Shift’ and a table called ‘Schedule’. ‘Shift’ has columns ‘shift_id, shift_start, shift_end, shift_day, shift_f…

How to group by multiple rows and column

For each user 3 codes are there(10,20,30) if all codes(10,20,30) are true then it has to JOINED if any codes(10,20,30) are False then it has to NEGLECTED WE have to check max(date) Table is below: Output user2 and user3 is JOINED, user1 is NEGLECTED Answer I assume that the column bool is of data type BOOL, s…