Skip to content

SQL Query with two different filters

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 …

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…

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 ‘…

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 …