Skip to content

Tag: sql

oracle sql Sort dated transactions by order of transaction

I have been working on this for a few weeks and I know there’s a way like using ROW_NUMBER(), but I’m just not too familiar with it, Or maybe there’s a better way…. shows this: It needs to show this: As you can see, there’s 2 delete dates for SKU 555454, and it has to show the la…

SQLite update data from one table to another

I’m trying to insert some data from one SQLite database to another. I have 2 tables called “members” and “attendance.” What’s supposed to happen is, everytime a new member is added into the member table (or removed), the name and ID of the specific member should also be add…

Postgres: Count multiple events for distinct dates

People of Stack Overflow! Thanks for taking the time to read this question. What I am trying to accomplish is to pivot some data all from just one table. The original table has multiple datetime entries of specific events (e.g. when the customer was added add_time and when the customer was lost lost_time). Th…

SQL Server 2014 slow remote insert

I have several linked servers and I want insert a value into each of those linked servers. On first try executing, I’ve waited too long for the INSERT using CURSOR. It’s done for about 17 hours. But I’m curious for those INSERT queries, and I checked a single line of my INSERT query using Di…

Break ranges into rows Teradata

I have an input like this: I would link to break each range into rows: I’m trying to get this output in TERADATA, can you guys help me? Thanks a lot. Answer Teradata’s proprietary EXPAND ON syntax is for creating time series, but can used for your task, too. Assuming TD16.20+ this can be further s…

Convert SQL to Laravel ORM RELATONS

It is working but I should do with Relaion Like this… But it is not working because whereHas returns a collection, What I can do ??? Please give advice. Answer This is working thank you !!!

Azure Data Bricks – Convert to Date for Ordering

I have had to construct a string that has a millisecond compoment as source where data is being extracted does not allow a date field to hold a milli second component. However not the problem .. Query The problem is that I can not order records in Azure Data Bricks Sql Analaytics using the STRING version of t…