Question: how to query SQL Server Agent – all jobs’ error message result set Input: Expected result: What I’ve tried & know: I know Job Activity Monitor GUI form can do it, but it only contains last run as shown in this screenshot: Answer I searched msdn and found dbo.sysjobhistory (Tran…
Calculate Time spent by users on the platform
I’m trying to calculate the time spent by users on my platform on a weekly basis. I have the following api_request_logs table (*Note: each row is duplicate) I tried this query, however, it doesn’t seems it is outputting correct calculation . Current output: Desired output : What I’m doing wr…
How to merge rows in sql
I am trying to understand how to merge two rows (which are the same) into one. They both have data that needs to be in the same row but the raw data currently has split them into two rows. Essentially,…
Need help to build a sales funnel report by sql query
I have created a view for sales.In this view, there are relations among lead, opportunity and quotation. We can see not every lead turns to opportunity and quotation. LeadID OfferingID QuotationID Product Salesperson Department Date Salesprice My final output for the sales funnel for all department will be li…
Python/Excel/SQL column dates to exploded rows
I have an Excel spreadsheet table like this where it shows how many units were sold each week for 2019 and 2020 (columns) and I am trying to put it into an access database formatted like the second …
SQL string in access VBA not behaving as expected
I have a bit of access VBA that for the life of me, I cant work out what is wrong. First off, here is the offending section of code, and I’ll explain what I want and what it’s doing below. …
inserting data from another project table in BigQuery
I’ve created two table , “conversion_log_” on project1 and “test_table” on project2 in Google bigQuery. I have been trying to select and insert data from conversion_log_ to …
Get the last login date for all users in Oracle 11g
We have Oracle 11g so the following query didn’t work. select USERNAME,LAST_LOGIN from dba_users Then I searched and people suggested multiple ways and i got confused. What is the correct way to get …
PostgreSQL LIMIT with OFFSET is not working beyond 100000
I am using postgres (9.6) docker for my project. After loading large volume of data, for example 234453, I need to cut data in chunks using limit and offset. But I have observed that my query is …
group by date and show the values of X(column) which depends on min time of that date and max time of that date in 1 row
I have table like I want to group by date which user has the id of u_id =1 and get first time and value of x and get the last time and value of x in same row it should be like what i’ve tried but i cant get the values of xs. the rows: Answer One method uses conditional