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 is the use of set nocount on/off statement?
How to delete duplicate rows?
Where are stored procedures in sql server?
What are the benefits of filtered indexes?
How to choose all records from the table?
How to find the version of sql server? : sql server database administration
What is a filestream?
What to check if a User database is locked?
Write a sql query to delete duplicate records from a table called table1
What is the difference between join and inner join?
Explain what is cte (common table expression)?
what are the different types of replication you can set up in sql server? : Sql server database administration
What are views in ms sql server?
How can a user-defined datatype be created?
Explain the etl (extraction, transformation, and loading)?