I have this table: I want to get this: The idea is to sum up the Col B of Quarter 1 with Col C of Quarter 2… and group by Col A Answer Very strange, but you can use conditional aggregation:
Joining results from 3 tables with same date
I have 3 tables like this: table1 ID Date Number City ——————————– 1 18.11.2019 345 Bristol table2 ID Date Type Code —————————-…
CUSTOMER and purchased CATEGORY count details in Oracle SQL
I am having the below require. if anyone provide the solution it would be thankful Requirements:- Transaction of the customer who purchased in the below category Customers and purchased Category Total Number of customer from category level category and customer count I want to display the output life below ou…
How to create external table in db2 with basic DML operation
I created external table with following command db2 ” CREATE EXTERNAL TABLE TEST(a int) using (dataobject ‘/home/db2inst2/test.tbl’ ) ) ” db2 “insert into TEST values(1)” db2 “insert into TEST …
Insert string at particular location on a loop
I have a csv file containing product numbers and I need to insert these into a string which will be later used as a SQL query. I can read and append the values fine but I cant format it correctly. …
How to convert list of comma separated Ids into their name?
I have a table that contains: I have the table that has the names of this tasks: I want to generate the following output I know this structure isn’t ideal but this is legacy table which I will not change now. Is there easy way to get the output ? I’m using Presto but I think this can be solved
Loop Concat in BigQuery
I have data like this : Time Route 11:03:01 home 11:03:04 category 11:03:10 product 11:03:21 cart I want to create this : Time Route Journey 11:03:01 …
How do i remove duplicate address line in plsql
I have org_name, add_line1 , add_line2, add_line3 which i have put on different lines by using (RTRIM(org_name) || CHR(32) || NVL2(RTRIM(org_name), CHR(32) || ‘line’ || CHR(32), ”) || RTRIM(…
SQL BETWEEN doesn’t SELECT given price range from 2 input filed
unable to SELECT db row from price between entered field, i tried with below code when i entered price range for 5000 to 8800 it selects all db row from price with first no.5 and 8. can some one …
How to write a mysql query for this requirement?
I have one table like below. I want to get the total number of books donated by donation_organization_group and distinct by donation_pledge. I wrote the sql query like below. select count(…