Select from following answers:- 0
- 4

- -1
- None of the above
- All Above
PATINDEX() function returns the position of pattern-match string;
For example,
SELECT PATINDEX('%NET%', 'DOTNETFUNDA') AS 'Index' -- 4.
Here Pattern is matching thats why returning position of NET
SELECT PATINDEX('NET%', 'DOTNETFUNDA') AS 'Index' -- 0.
Here searches for string starting with NET and then one or more chars ( For example NETA, NET, "NETsdsadf", "NET 3253".... But out string starting with DOT.. So result is 0
SELECT PATINDEX('%NET', 'DOTNETFUNDA') AS 'Index' -- 0
Same as above
Show Correct Answer
Asked In: Many Interviews |
Alert Moderator