Skip to content

Tag: sql

Oracle sum group by column range with different starting points

I have below sample data. i want to find the total sum(amount) of each respective user_x but starting from sdate assigned to each user. the sdate in the respective users does not change What i have tried below returns all the results, i just want one line result for each user_x This is what i want How can i d…

How can i make this Complex query for SQL database

I have a database that looks like this: Player (UserId, Mail, Password, Username, LastLogin) Leaderboard (UserId*, Level, Kills, Deaths) Match (MatchId, HostId*, ServerIp, StartTime, Team1Points, Team2Points) MatchStats (UserId*, MatchId*, Kills, Deaths) Weapons (IdWeapon, Name, Damage, FireRate, ReloadTime, …

Double sort in Excel or SQL

I have a weird table-sorting issue that I cannot figure out in Excel or SQL. Here’s a table sorted by column 2, “Letter”. Name Letter Dan A Moe A Ted B Dan C Joe F Noe F What I need is the table sorted by Letter BUT… if there are any duplicates in the “Name” column, I need …

Catch block not being executed

A QA tester in my company noticed that the catch block in an insert..exec statement is incorrectly attributing the error to the outer procedure instead of an inner procedure. The inner procedure is being called in several different places in various stored procedures. It’s working fine, but I was tasked…

Add subquery in query – Oracle SQL

My query return all days in month. How get all days from query where DAY_ID not in ==> (Select day_id from table1) Eg. table1 return 5,10,15 Query resault need to display all days except 5,10,15 Answer You can generate your calendar and then use NOT EXISTS: Which, for your sample data: Outputs: DAY DAY_ID …

To check whether entered number is odd or even in PL/SQL [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed las…