Skip to content

Track customer loss in redshift

I have a data base that looks like this. It has: acct_open_dt, or the day the account was opened. acct_close_dt, or the day the account was closed. dayssinceopendt, which is TODAY – acct_open_dt if …

Casting the Bigint number Returns NULL

I need o convert a integer value to the highest data type in hive as my value is of 25 digits NULL value will be returned for the above select stmnt; I am very well aware that the supplied number is greater than the largest number of Bigint. But we are getting such values upon which i have to calculate

Ranking based on two columns

Finding the Rank of the Particular User from the Database by comparing three columns. Name | Score | Attempts | Time test | 2 | 4 | 2019-01-29 19:50:11 tes2 | 2 | 1 | 2019-01-…

How to Run Two T-Sql Statement By Exec Command in SqlServer?

I want run 2 SQL queries in Exec instruction, how can I do this? ListOfLeaveRemainingInfo is a user-defined table type: When I run the stored procedure, I get this error: Msg 1087, Level 15, State 2, Line 33 Must declare the table variable “@LeaveRemainingTempTable” Answer Scratch the previous. @L…

SQL Joins for Multiple Fields with Null Values

I have a table of maintenance requirements and associated monthly frequency it is to be performed maint I also have a table of equipment with data on its manufacturer, model, device type and building. equip I am trying to match each maintenance requirement with its associated equipment. Each requirement appli…