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 / rajesh bhawsar
select name,
(case left(cardno,1)
when '4' then 'visa'
when '5' then 'master'
end) as result from account
Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
What is log cache in sql server?
Where are full-text indexes stored?
We need to perform what steps in the following order to work with a cursor?
What is a scheduled job or what is a scheduled task?
How to change parameter value inside the report?
Explain different types of index?
What is the openxml statement in sql server?
What are the five major components of a dbms?
You want to implement the one-to-many relationship while designing tables. How would you do it?
How to add a new column to an existing table with "alter table ... Add" in ms sql server?
What is the importance of a recovery model?
What is mapping schema?
Explain about system stored procedure?
What are the steps to process a single select statement?
How secure is sql server database?