I have decimal fields (DECIMAL(8,0)) that contain dates as 5122019 for may 12th 2019 and 12122020 as December 12th 2020. I’ve tried several ways to convert including DATE(TIMESTAMP_FORMAT(CHAR(decimalField),’MMDDYYYY’)) but they return null. What’s the best way to do this with a decima…
Nested JSON parsing using Snowflake SQL
I have a problem parsing a certain nested JSON structure in Snowflake. The problem here is the usage of special characters like @ and # for example for some of the elements. Those characters prevents me from using simple dot notation when trying to access some of the elements without resourcing to a really co…
IBM DB2 CAST AS VARCHAR versus Python Pandas to_datetime Function
I have the line in a SQL file hitting an IBM DB2 database. For various reasons, I have to convert to VARCHAR, so leaving out the CAST is not an option. The problem is that this casting is choosing a very poor format. The result comes out like this: 2020-06-09-13.15.00.000000. We have the four-digit year with …
SQL Write a request that returns: Customers – only who have had at least one order every day in the last month [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question Dynamics of the number of orders by customers who created at least one order every day. You h…
MySQL transform 3 queries into one
I have 3 working simple queries. How could I transform in one query? Thanks Answer I am guessing you want:
coalesce, nvl and CASE not working for count(*) in the subquery
I have a query with CTE and I want 0 for the NULL rows. I want to why COALESCE(tsting), NVL(tsting2) and CASE(rw_cnt) is not working? Am i missing anything? And I get data like below: Any suggestion for the query optimization is welcome… 🙂 Answer You are doing a LEFT join of dte to tmp, so you get nulls…
Read data from excel using column name and insert in to SQL table in C#
I am implementing a system to upload exam marks using Excel sheet. Excel sheet content the student Index number, Name and Grade and the Exams they have taken with Pass/Fail status. Names of the exams …
Need to exclude the data which have multiple records
I am trying to build a query to get the the unique data from data base, but here the problem I’m facing there is some records which have multiple records and those records have null and not null values.. I have to pick the value of the record which have the latest created date and it’s data is nul…
Compare procedure Definition within two databases
We have an instance of Sql Server 2012, In the Instance we have 2 dbs called A and B ( Assume A as production DB and B as Development DB and B is the exact copy of Database A ) suppose For Development Purpose,Some procedure ( Already Existed,Not Newly Created ) definition were changed in database B but not in
ZPL Loop function
I’m looking for any idea can help to setup a ZPL label using a loop function to gather the information from SQL Table and print them on a label I have a Table in SQL DB has those fields Product QTY ORDER_NR for example: I have the order 111022 has 3 items lines 50023 50037 50099 And I want to