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
Why do we use functions?
How to define output parameters in stored procedures?
What is the difference between update lock and exclusive lock?
Can you get second highest salary from the table?
How to execute the cursor queries with "open" statements?
What is a DBMS, query, SQL?
What are the requirements to use odbc connections in php scripts?
What is the benefit of normalization?
What is for xml in sql server?
Explain comment on transactions?
How to enter binary string literals in ms sql server?
How to restore performance issues and how to check?
Explain ms sql server reporting services vs crystal reports?
What are extended events in sql server?
What are the triggers in sql?