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 / kiranu
Hi every one
select name, cardno(case substring(cardno,1,1)when '4' then
'Visa' when '5' then 'Master' end) as Result from account;
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is triggers and stored procedures?
What is efficiency data?
Why functions are used in sql server?
Which are the new data types introduced in sql server 2008?
Tell me what is the order in which the sql query is executed?
Mention the uses of stored procedures.
What is merge join?
In which files does sql server actually store data?
what are the new features introduced in sql server 2000? : Sql server database administration
Which operator do you use to return all of the rows from one query except rows are returned in a second query?
Where do we use trace frag?
Can we insert data if clustered index is disabled?
What are the advantages of policy management?
What is the difference between DATETIME2 and DATETIME?
What are statistics?