Skip to content
Advertisement

postgresql – condition met in a time interval

I have the following table and I want to create the condition_met column. The condition_met column is my expected output. Condition_met is TRUE when type_id = 34 and within 5 seconds after this type_id, the client_id of type_id = 34 becomes also prospect_id. To say it differently: for each type_id = 34 the client_id that performed action type_id = 34

Find the number of employees working under a manager

I have three tables called branch,employee and manager structured like this I want to view the id of each manager and the count of the employees he has under his supervision like this I have made this so far that shows which branch each manager works on but i don’t know how to proceed with the counting. The solution i

Get monthly sum/agv/max of a measurement from timestream

I am storing measurements in Timestream with the following attributes (example): Let’s assume these metrics are written one per day. How do I have to query the data in order to get a monthly sum on the request count metric for a specific domain? In order to get a sum for the whole time range queried I can do this:

Does Pervasive Have a SQL Function for URL Encoding?

I’ve written a query that builds some URLs to an intranet site, but some of the URLs don’t work because they contain special characters that need to be URL encoded. I’m trying to avoid writing a script (outside of SQL) to do the URL encoding; I’d like the database to do URL-Encoding instead, so that I can just export the

Save SQL Query Results in Variable

I have the following SQL Query, but it is very repetitive and so I am wondering if this can be cleaned up by storing the results of a SQL Query in a variable. What I have is (which works, can be …

Can’t do Multiple Left Joins SQL Select (ODBC)

When I run the following SQL select statement with two left joins: I get the following error message in Excel VBA: “Run-time error ‘5’: Invalid procedure call or argument” When I run that exact same SQL without the left joins, it works without issue. I know the first SQL statement above is valid because it works just fine (joins-included) when

Advertisement