Skip to content

json_contains issue with the query, like

I try to find a food with some categories stored in the categories column as json. My query : select * fromfoodswhere json_contains(categories, ‘[“Aliments”]’) this should return at list one element …

how to use GROUP BY based on 2 specific columns

I have a table in SQL Server which looks like this : each ticket id can have multiple order issue. On each row I need to calculate ticket full revenue as below : SUM(revenue) of all items within the same ticket id So in my case, ticket id has 3 items (10,20,30) so the ticket full revenue = 30+5+15 =

What is the correct syntax?

I wrote a sql query to update data of ‘tbl_products’. Here is the query update tbl_products set product_count = (product_count – tbl_order_details.product_sales_quantity) from tbl_products join …

calculate the percentage with sql and DOMO

I have a table where I want to calculate the percentage of revenue using the following formula: (Advertiser Revenue / Total Revenue) * 100. Data => Here is my code and what I have tried: Error: syntax error: execute command denied to user Answer In Domo, this calculation would best be done at the visualiza…

Return multiple values in varchar2

I want to return the values of several columns (With a function) in a varchar2 but I get an error when I choose several columns in select. FUNCTION FU_PRUEBAS (P_IDNUM MAC.IDNUM%TYPE) RETURN VARCHAR2 …

Case statements around values in a list

I have a table that looks like below after performing certain joins: create table test(id varchar(10), sub varchar(20)); insert into test values(1,’a’) insert into test values(1,’b’) insert into …