i have account table which consists of account name,card no
and card no consists 16 digits now i want to retrieve the
data if card no starts from 4 then it should print visa and
if it starts from 5 then it should print master so plse help
me to write simple query with out store procs .
Answer Posted / rahul
hi every one.
select name,
case
when card_no like'4%' then 'visa'
when card_no like'5%' then 'master'
end result from account;
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What are subqueries in sql server?
what is the information that can be stored inside a bit column? : Sql server database administration
How retrieve field names from the table in SQL through JAVA code?
How to drop existing views from a database in ms sql server?
What is report subscription?
What is table valued function and scalar valued functions?
How can you hide the sql server instances?
Explain alternate key, candidate key and composite key in sql server?
How to truncate the log in sql server 2012? : sql server database administration
What is the difference between locking and multi-versioning?
How to find which stored procedure is currently running in sql server?
What does it mean to normalize a database and why would you do it?
What is the difference between delete and truncate statements?
What are various limitations of the views?
What are the components of dbms?