I am looking to estimate a queue length for historical data at the time a record enters the queue. I would like to do this by counting how many of the rows in the data set have an enter time less than the enter time of the record, and an exit time greater than the enter time of the record.
How to Get list of ids from same query when returning as JSON
apps table I have a query, SELECT * FROM apps WHERE app_status = “ACTIVE” FOR JSON PATH; This query has an app_id field. I also want a field to accompany the json output with a field ids with all the app_id as a list. So instead of: I would have: Answer This returns the correct JSON Data Query Out…
UPDATE ACROSS JOIN SYNTAX
I am trying to get an update statement to function how I need. I’ve tried the following with INNER / OUTER LEFT / RIGHT JOINS. I continue to have records that are not updated in the usertype2 table despite having usertype3 child values. Am I going about this the right way? Usertype2 and Usertype3 will a…
Reference to database and/or server name is not supported in this version of SQL Server
Objective I’m trying to put data from a couple different Azure databases into a new Azure database with a script similar to the following: Essentially I am creating the tables in the new database with the exact same schemas that are in the source databases and then trying to insert all of data from thos…
The multi-part identifier “t7.rate_buy” could not be bound
Please help me on this error message: The multi-part identifier “t7.rate_buy” could not be bound. I can’t find how to fix this. I use SQL Server 2012 and I have tried everything but I can’…
Datalist Control not showing any Paragraphs
I have a datalist control that gets populated from a htmlTextEditor control. The Datalist is ignoring all my paragraphs. In the htmlTextEditor I Enter: Test – Please Ignore Test Test Test But the Datalist shows Test – Please IgnoreTesttesttest What is happening here??? Help!! In the Database the t…
Create and Run Query in Postgresql Procedure
I want to create a postgresql procedure which creates a query and run it. I tried and research on forums. But i can not solve my problem. Procedure should get user input as a parameter and use it in query. My code like that : And this is the error : edit: form_field is a table. create statement : Answer
Why PLSQL optimize level is not providing expected result?
I am trying to understand complier optimizations in plsql in depth. Theoretically, default optimisation level PLSQL_OPTIMIZE_LEVEL is set to 2. To get better performance, we can set it to 3. To …
Flyway don’t clean database correctly, and execute migration files two times
I’m using flyway for migration database, as well I use FlywayTest for my integration tests, but When I create a test using : I get this error : If you not : This comes from FlywayTestExecutionListener.class but it migrate the database again. Why flyway do this, and how can stop this. More details The pr…
MySQL select all column names where condition is met for specific row
I have a table which links users to groups which is set up as below: I would like to know if there is a method to select all groupIDs (column names) where a certain condition is met. E.g. if I want to find all groups where user 2 has a level greater than 0 it would return (1,2,4) It is