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
explain different types of backups avaialabe in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration
How to get a list of columns using the "sys.columns" view in ms sql server?
Insert syudents details in table.Current system date &time insert into joining time.How do insert?( in sysdate only return current system date how do add time?)
Can we add an identity column to decimal datatype?
What are the different types of join?
What does it mean if @@cursor_row returns a negative number?
What is an index in a database?
How do clustered indexes store data?
how you can list all the tables in a database?
how to restart sql server in single user mode? How to start sql server in minimal configuration mode? : Sql server database administration
Which event (check constraints, foreign key, rule, trigger, primary key check) will be performed last for an integrity check?
In one interview...interviewer ask me question pleas tell me sql server architecture.. can any body tell me the sql server architecture with digram
What action plan is preferred if sql server is not responding?
What is database isolation in sql server? : sql server database administration
Define tool Manage Statistics in SQL Server 2000 query ?