I have a page which shows all cars from DB. I have two filters , both are multiple select filter. For example filter 1 – Color Red , green , blue <– All these are checkbox ,can be selected …
Presto: Removing last element from variable length array
I have arrays getting past through of variable lengths. I need to remove the last element. Example: Array[1,2,3] -> Array[1,2] Array[5,2,1,4] -> Array[5,2,1] I have attempted to set up slice(Array[]…
problem with script creating table via if clause
We are trying to build a script which automatically checks if a table is already created and if so the script should end. If the table is not created the script should create it. case if …
Equivalent of string contains in google bigquery
I have a table like as shown below I would like to create two new binary columns indicating whether the subject had steroids and aspirin. I am looking to implement this in Postgresql and google bigquery I tried the below but it doesn’t work I expect my output to be like as shown below Answer Below is fo…
I need a Row_number over partition to achieve this in SQL Server
I have three columns PID, AppNo and ProcessedDate I need a query to update the AppNo in the format below PID AppNo ProcessedDate 11 1 09/30/2019 18:21 3 1 09/25/2019 08:37 3 2 …
Ordering with PostgreSQL trigger when updating and inserting
I’m looking to sort the rows based on a variable. I’m pulling my hair out trying to wrap my head around this kind of trigger. I’ve only ever written triggers that gets some values from other tables. …
Creating a group by of a group by
I’m sure this is really straightforward, but I’m struggling! I’d like to create a group by for the count of the incidence of a value, eg. there are two incidences of case_id ’10’ and two of case_id ‘…
In Peoplesoft 8.5X Query Manager, Is there a way to default EMPID in filter criteria based on employee sign in?
I want to dynamically create a filter criteria in PS query manager which automatically picks EMPID value based on employee sign in ID. Is it feasible in Peoplesoft 8.5X ? I am a beginner to Peoplesoft query creation. I have not tried anything yet. SELECT A.EMPLID FROM PS_JOB A WHERE A.EMPLID = ‘XXXXR…
Correct json formatting in ms sql server
I have the following SQL table I wrote this code to format result as JSON, but can’t get it in the desired format. If i name all product columns as name then sql returns an error Use different names and aliases for each column in SELECT list. Sql code: Current output: Desired output: Answer You may try …
How to increment date using previous value from same column and skip weekend date?
I have tried to increment date based on other date column and skip weekend date. I know how to check weekend and how to skip date but I want to result as look like below EX. If I will input date in one column like then I want result in new column like NOTE: don’t skip any row from input