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
Is there a way to create an ‘indicator’ in an SQL(DB2) select query to indicate when a column is filled?
This title is vague as hell and doesn’t completely cover the problem, but I don’t know how else to word it. Basically, I have the following situation: I have two tables: Table 1: COMPANY. shows company parent-child structure company parent-company A NULL B A C A D A E B Table 2: ACCOUNTS. accounts linked to companies company account-id account-currency
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
How to fill a SQL column with data (calculated) from another table
I have a question and don’t know how to approach the problem exactly. I have two tables as following: “Reference” in the “Client” table is defined as foreign key. Is it possible to fill the column “count” in the table “Tour” with an automated formula where it counts how many times the t_id appears in the “Client” table? Something like:
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
How to get count of particular column value from total number of records and display difference in two different columns in SQL Server
I am trying to get difference between total records and a column (Is_Registered) to get Month wise matrics of how many registered in particular month and how many are pending Actual Data Expected Output -As shown in actual data, out of 8 users(records) 2 are registered in Jan and 6 are not ,in February total 3 are registered i.e. Jan’s
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