Logo 
Search:

SQL FAQ

Submit Interview FAQ
Home » Interview FAQ » SQLRSS Feeds

What will SELECT SUBSTR LASTNAME,1,5 FROM NAME_TBL; query retunr?

  Shared By: Shruti Sharma    Date: Dec 21    Category: SQL    Views: 690

Answer:

No, missing () around lastname,1,5. Also, a better plan is to give the column an alias. The statement should look like this:

SELECT SUBSTR(LASTNAME,1,5) NAME FROM NAME_TBL;

Share: 
 



Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: