Skip to content
Advertisement

Tag: subquery

Can this be done as a SQL VIEW

I have a SQL Server table of Customer’s Events: There can be many EventTypes for the same customer in one day. EventTypes are like 1 – CheckIn 2 – CheckOut 3 – ExamStart 4 – ExamEnd Now I want to select Customers that are currently (today) on premises. That’s Clients who had checked in, but hadn’t checked out, no matter

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

tsql to find members not contacted in past 18 months

I have a table that has ContactNumber (Bigint), MemberNumber(bigInt) and ContactDate(date). The table has millions of records (sample data image attached). I want to get all the records where member has not been contacted for last 18 months. How do I do that using tsql? Your help is highly appreciated. Thanks. Answer You must have a Member table containing all

Oracle “NOT IN” not returning correct result?

I’m comparing two tables that share unique values between each other using NOT IN function in Oracle but I’m getting the output is: 521254 for all charging ids –< this is the total unique charging ID’s in BILLINGDB201908 Now I want to find id’s in table BILLINGDB201908 that also exist in table CBS_CHRG_ID_AUG — the result back315567 charging ID exist

Advertisement