May 13, 2010 at 3:54 am
All,
Does SQL2005 support CREATE ASSERTION statement?
Does Sql2005 support SUM(POSITION()) ?
I have seen a video on SQLUNIVERSITY.NET. In that video i saw the below code
SELECT race,
SUM(POSITION('male' IN sex) AS male_tally,
SUM(SIGN(ABS(POSITION('female' in sex) AS female_tally
FROM Personnel
GROUP BY race;
karthik
May 13, 2010 at 4:15 am
Does SQL2005 support CREATE ASSERTION statement?
>NO, you will need to use CHECK constraint (unfort. a bit different to SQL-92 CREATE ASSERTION idea)
Does Sql2005 support SUM(POSITION()) ?
>NO, use CHARINDEX/PATINDEX instead
May 13, 2010 at 5:23 am
karthikeyan-444867 (5/13/2010)
SELECT race,
SUM(POSITION('male' IN sex) AS male_tally,
SUM(SIGN(ABS(POSITION('female' in sex) AS female_tally
FROM Personnel
GROUP BY race;
That's not SQL Server code. A very quick google search reveals that PostgreSQL supports that function.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply