Skip to content
Advertisement

MS SQL identify duplicate rows based on log time

I have a fairly simple database table that logs every time a tray passes over an RFID reader. What sometimes happens is the data is being sent twice, so I have been asked if I can find out how often this happens. Rather than spending the next few days going through every record in the log table, I presume there

MySQL: Return a row if all joint table row have the value true

I’ve two tables as following. The relationship is What I want is to return for example for table A the record with id 1 which has a relationship with table B where all the values on table B column Delivered as true. Answer You can use group by and having: This doesn’t use table a. If you want all the

Variable length substring between two characters

Data looks like this: I want it to look like this: It’s pretty simple to get rid of one or the other. This: Gives me this: Initiative: Credible Sources Initiative: Just in Time Initiative: Database Normalization And this: Gives me this: Having a hard time figuring out how to combine the two. Answer How about just using substring()? Or, if

Oracle sql | Share generated by default on null as identity

Is it possible to share the same “pool” for ids when using following syntax? When both attribute have the same name? The only possibility I came up was to start both at different values. Like Test on 1000 and test 2 on 2000 but this is not a long term solution. I’m looking to a solution where I can “share”

ORA-00907: Missing Right Parenthesis on a left join of two subqueries

It’s been a little while since I’ve messed with SQL and I’m picking it back up for a course. I need to create a table of table name, column name, constraint name, and constraint type for all tables with my user, but every time I try, I’m getting a missing right parenthesis error. Here’s my code so far: SQL Developer

Why does my SQL query not have any columns?

I’m not an expert by any means but I write SQL queries fairly regularly. I am pulling data via Crystal Reports 2013 from SQL Server 2016 (not positive about the version). Just as an aside, CR permits parameters so that’s what {?DateStart} is. {?DateStart} and {?DateEnd} are regular dates, {?ServiceProvider} is a number array. The EXEC sw_vwDateRange generates a table

Finding only active items from a column of ‘added’ / ‘removed’

I’m attempting to write a query that tries to find the most recent items. Given a set of parent_service_items find the relevant child service items and return a list of them. For finding just the direct children, I’m using query which simply finds all the associated children. I then use this query in a recursive postgres function that goes until

Advertisement