Hi,
I'm trying to select a set of records from sql server, something like:
What I want to do is whenever table.SD_FirstName = 'Joe' or table.SD_Surname = 'Bloggs' that iRank is incremented by 1 (but keeping the likes in the where clause)
Does that make sense?
Thanks,
I'm trying to select a set of records from sql server, something like:
Code:
DECLARE @iRank INT
SET @iRank = 0
SET NOCOUNT ON
SELECT table.ID, table.SD_Surname, table.SD_FirstName,table.SD_Initials,
table.SD_Born, table.SD_Resident, @iRank AS iRank
FROM table
WHERE table.SD_FirstName LIKE 'Joe' OR table.SD_Surname LIKE 'Bloggs'
What I want to do is whenever table.SD_FirstName = 'Joe' or table.SD_Surname = 'Bloggs' that iRank is incremented by 1 (but keeping the likes in the where clause)
Does that make sense?

Thanks,