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
How to enter unicode character string literals in ms sql server?
Do you have any idea about the tcl commands?
How to get a list all databases on the sql server?
What are the types of table?
what is raid and what are different types of raid configurations? : Sql server database administration
What is candidate key with example?
Explain Reporting Life Cycle?
What are the different kinds of ssrs reports?
Explain about local stored procedure?
How to call a function from a stored procedure in SQL Server ?
What are the differences between user defined functions and stored procedures?
How to replace null values in expressions using isnull()?
What is transaction server consistency?
What command would you use to create an index?
How to deploy the Report?