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
How to get a list of columns in a view using the "sp_help" stored procedure?
what is a live lock? : Sql server database administration
What options are available to audit login activity? : sql server security
How many types of database relationship in sql server?
Once setting replication, can you have distributor on sql server 2005, publisher of sql server 2008?
what are the types of indexes? : Sql server database administration
on line cluster can we make if yes tell me the procedure
What does asynchronous call backs means?
What is table valued function and scalar valued functions?
Explain DBCC?
Is null in sql server?
What are the new features introduced in SQL Server 2000? What changed between the previous version of SQL Server and the current version?
Explain the disadvantages/limitation of the cursor?
Explain sql server service broker?
Can I delete event logs?