Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

1.how to find the dead lock in sql server? 2.How to fine the memory leaks in sql server? 3.suppose transaction log file increasing what action will take ?

2028


How to drop an existing user defined function in ms sql server?

1031


what stored procedure would you use to view lock information? : Sql server administration

978


How to delete existing triggers using "drop trigger"?

1059


Describe different Processing Modes offered by SSRS?

251


Do you know the policy based administration feature of sql server 2008?

962


What are the different kinds of ssrs reports?

214


What is model database? : SQL Server Architecture

1137


Does partitioning ssd reduce performance?

898


What is sub query and its properties?

975


Please explain what is “asynchronous” communication in sql server service broker?

942


What are the differences between web role and worker role?

122


can any body tell me how to know the password of current user in sql server

2077


What are different types of schemas?

947


What is join query?

899