Viewing 10 posts - 1 through 10 (of 10 total)
Kingston Dhasian (6/14/2013)
SELECT*, CAST( ( game1 + game2 + game3 + game4 + game5 ) / 5.0 AS NUMERIC(10,1) ) AS [percent]
FROMcte_Students
Thanks...
June 17, 2013 at 7:50 pm
ChrisM@Work (6/13/2013)
-- sample data;WITH students (ID_Student, Name, rate) AS (
SELECT 1, CAST('Chipper Jones' AS nchar(30)), CAST('678*9' AS nchar(5)) UNION ALL
SELECT 2, 'Mike Piazaa', '98***' UNION ALL
SELECT 3, 'Barry Bonds', '678**'...
June 13, 2013 at 6:30 pm
Kingston Dhasian (6/13/2013)
The below code will avoid the issue
; WITH cte_Students AS
(
SELECT*,
CASE WHEN SUBSTRING(rate, 1, 1) =...
June 13, 2013 at 6:19 pm
Kingston Dhasian (6/12/2013)
; WITH cte_Students AS
(
SELECT*,
CASE WHEN SUBSTRING(rate, 1, 1) = '*' THEN '10' ELSE SUBSTRING(rate, 1, 1) END AS...
June 12, 2013 at 8:21 pm
Pelon (6/4/2013)
Kingston Dhasian (6/4/2013)
SELECT*,
CASE WHEN SUBSTRING(rate, 1, 1) = '*' THEN '10' ELSE SUBSTRING(rate, 1, 1) END AS game1,
CASE WHEN SUBSTRING(rate, 2, 1) = '*' THEN '10' ELSE...
June 11, 2013 at 7:08 pm
Thanks for your help.
Now I have a doubt, I would like to add the numbers of each column and after add them i want divide them to get ...
June 11, 2013 at 7:04 pm
Kingston Dhasian (6/4/2013)
SELECT*,
CASE WHEN SUBSTRING(rate, 1, 1) = '*' THEN '10' ELSE SUBSTRING(rate, 1, 1) END AS game1,
CASE WHEN SUBSTRING(rate, 2, 1) = '*' THEN '10' ELSE SUBSTRING(rate,...
June 4, 2013 at 7:30 pm
Sean Lange (6/2/2013)
You don't need to split this to achieve the results you are looking for. All you need is a simple replace.
select replace(Name, '*', ' ')
Yes, it works !
Thank...
June 3, 2013 at 6:25 pm
Viewing 10 posts - 1 through 10 (of 10 total)