How can I insert the data based on data count from another table in SQL? Store table: StoreCode StoreName ———————– HQ HQ Mini Mart BT BT Mini Mart …
Tag: sql
How to structure this case when expression in the where clause?
I have a parameter where there are three available options, “ecom”, “nonecom”, and “both”. When the parameter is set to “ecom”, I want there to be a where clause where it says Customer_Number = ‘…
Azure mobile EasyTables connection string
I am fairly beginner in here, so any help would be much appreciated 🙂 So, I created a SQL Database and I want to connect EasyTables to it. Apparently the automatic option has been removed and I have …
What is the purpose of the string “- 4/24” from a record that holds a date?
I have an already generated script that uses the following code: ORDER BY TO_CHAR((A.VERIFIED_DTTM – 4/24),’YYYY-MM-DD’). The output of A.VERIFIED_DTTM is a simple date eg: 09-SEP-19. I was my …
Asp.Net adding an extra td
I’m trying to use an ASP:DataList to display data from my data source. Everything works ok, except I’m getting ASP to add an extra column when there isn’t one. The Header Template and Item Template …
How to improve SQL query performance for HAVING (SQLite)
These 2 queriess are taking several minutes on tables of several millions rows (2 tables: torrents and dates). None of the columns are indexed I believe. I don’t know SQL well. Is there any way to …
refactor duplication of SELECT inside CASE inside SELECT statement
how to refactor this select statement to remove duplication select ( case when ( select my_product_int_attribute — duplication from app_public.products where …
Replace aggregated duplicate value in unique rows
I have a table in which each row represents a different event, with one of the fields providing a value aggregated across all the unique events that occur within that id. For example: +—————…
Add nested column to BigQuery table, joining on value of another nested column in standard SQL
I have a reasonably complex dataset being pulled into BigQuery table via an Airflow DAG which cannot easily be adjusted. This job pulls data into a table with this format: | Line_item_id | Device …
How to fetch related source and destination Flights from table
Hi My table consists of: source destination LA BOS LA BOS Seattle BOS Bos LA BOS Seattle NY Seattle CA LA LA CA LA Chicago CA BOS BOS Seattle I am trying to fetch if my source either …