There is a top level weight for a shipment but within that there is several weights for handling units. If one of these handling units has no value then I want the shipment to not show up in my query….
LEFT JOIN not showing days with zero COUNT
I am trying to retrieve data from the last X days, counting the new rows per day. I need to get also the days that have COUNT = 0. My query right now is: SELECT COUNT(*), CAST(TIMESTAMP_T AS DATE) …
SQL query how to divide values from two columns from the same table in different condition
Supposed I have some sample data in table_name_a as below: code val remark date ———————————– 1 00001 500 111 20191107 2 00001 1000 222 …
Creating and calling a function in a pl/sql program
I created a function to return a rental ID that is then used in an anonymous PL/SQL program that calculates the total cost of the rental given the price of the tool rented and the number of time units …
Retrieve max date
I am trying to retrieve only the record with the max ELIGIBLE date. I have two orders in a table with the same order number. The difference in the orders is that the ELIGIBLE dates are different. I …
MySQL Workbench: “SELECT” is not valid at this position for this server version, expecting : ‘(‘, WITH error
I have the following SQL query which I have written in MySQL Workbench: SELECT t1.sample_id, t1.v_id, t1.s_type as type, t1.s_fusion, t1.e_fusion, CONCAT(t1.cpt1, “:”, t1.ppt1) as point1, …
Salesforce Marketing Cloud SQL PIVOT
I’m trying to create a pivot in SFMC to combine multiple rows into one column. The query is running successfully, but not populating correctly. My table has 2 columns: email address and product_sku. …
I am trying to create a table in SQL and keep getting an error
I’m using Teradata SQL assistant to create a table. The code I am using is as follows: CREATE TABLE calendar ( CalendarKey INT NOT NULL, FullDate DATE NOT NULL, DayOfWeek VARCHAR(20) …
Adding a column to pull in name of the table in union query
I have 2 queries that I want to combine before exporting to Excel. I used a UNION query to do so, which worked great. Now I want to create a column that says the name of the table it came from. What …
SQL summing the same column with different date conditions
I’m using one table and am trying to sum total spend for two separate years, pulling from the same column. Essentially I have a list of customers, and I’m trying to sum their 2018 spend, and their …