CREATE TABLE [Changu143Aa].[UserSalesVolume]
(
[ID] [bigint] IDENTITY(1,1) NOT NULL,
[UserID] [bigint] NULL,
[PSV] [decimal](18, 2) NULL DEFAULT ((0)),
[GSV] [decimal](18, 2) NULL DEFAULT ((0)),
[DateAdded] [datetime] NULL,
[Pin] [uniqueidentifier] NULL
)
This is the structure of my table. I need to display user designation depending on type state
FIELD EXECUTIVE if (sum (gsv) <100 and sum (PSV) <2500)
FIELD MANAGER if (amount (PSV)> = 100 and amount (PSV) <500 and amount (GSV)> = 2500 and amount (GSV) <10000)
REGION MANAGER if (amount (PSV)> = 500 and amount (PSV) <2500 and amount (Gsv)> = 10000 and amount (Gsv) <= 50000
REGIONAL MANAGER if (amount (PSV)> = 2500 and amount (PSV) <5000 and amount (GSV)> = 50,000 and amount (GSV) <2,500,000
How can I display UserIDwith full PSV value and general GSV and designation?