Skip to content
Advertisement

Tag: select

MySQL select based on earlier row’s data (audit table)

I have an audit table that is structured as follows: This table is tracking whether we were able to successfully source a particular data point for a customer. Sometimes we are able to find the data on the first attempt, and you know this because there was no entry with a status of failed, the first occurrence of a particular

Select Distinct Top One Record by Date

I am writing a script to compare software between servers but have a many-to-many relational situation to execute this cleanly. I’m thinking a distinct-top by latest date type of query may help. So that I can go from this To this shortened and clean list I am not exactly sure how to approach this? Should I start with a sort,

SQL many joins many to many

I have 5 tables: Table Reports Many to many table ReportsIpRel Table of InfoProviders Many to many table QueriesIpRel And table of Queries The SELECT I am trying to achieve is the following: I tried many left/inner joins like this: but all for nothing. I have to use where condition: WHERE report_Id = ‘2’ /EXAMPLE I’m trying to do this

Advertisement