Interview Question
Country: United States
top n means it may be 5 or 6 or etc and dont use in built functions such as TOP or limit and etc
TOP is not a built-in function. It's a keyword that's part of the language.
You can avoid using the exact words TOP and LIMIT, but you'll have to use some other keyword or built-in function to impose some sort of ordering. I could use something like RANK() for instance, but that actually is in fact a built-in function.
For questions like this, it goes without saying that you should be super clear on what the allowed set of language constructs is.
SELECT TOP N FROM EMPLOYEE ORDER BY SALARY DESC
- PG September 05, 2012