Skip to main content

New answers tagged

4 votes

DB2 SQL statement to split a string based on delimiter

Depending on which version of DB2 are you using there is the SPLIT table function: Example: ...
Nifriz's user avatar
  • 149
5 votes

A schema for awallet system that allows transfers between users

Time zone Instead of using naive datetimes, I would strongly recommend time zone-aware types eg TIMESTAMP WITH TIME ZONE. See relevant doc for available options. A ...
Kate's user avatar
  • 7,338
6 votes
Accepted

A schema for awallet system that allows transfers between users

redundant wallets CREATE TABLE wallets ( id UUID PRIMARY KEY ..., user_id UUID REFERENCES users(id), ... currency VARCHAR(3) ... This isn't ...
J_H's user avatar
  • 32.4k
2 votes

Clean up verbose code for Oracle SQL

"Be kind to my mistakes"--Kate Bush It's been more than 2 decades since I dabbled in SQL. My meager hope is to help the OP understand what it is they are seeking to achieve. Shallow ...
Fe2O3's user avatar
  • 1,917
4 votes
Accepted

Clean up verbose code for Oracle SQL

tidy data Column names like FY17 or FY24 are not helpful. You want just a single FY column, which has values like 2017 or 2024 in different rows. Hadley Wickham describes the concept in some detail. ...
J_H's user avatar
  • 32.4k
4 votes
Accepted

Faster Query to Track State changes in a Large Table

Your originalvalue column is denormed and is perhaps a distraction. What really matters is newvalue, along with its associated ...
J_H's user avatar
  • 32.4k

Top 50 recent answers are included