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

How to enter unicode character string literals in ms sql server?

1051


Do you have any idea about the tcl commands?

947


How to get a list all databases on the sql server?

1076


What are the types of table?

960


what is raid and what are different types of raid configurations? : Sql server database administration

1019


What is candidate key with example?

963


Explain Reporting Life Cycle?

125


What are the different kinds of ssrs reports?

213


Explain about local stored procedure?

942


How to call a function from a stored procedure in SQL Server ?

1002


What are the differences between user defined functions and stored procedures?

1050


How to replace null values in expressions using isnull()?

1081


What is transaction server consistency?

1023


What command would you use to create an index?

1038


How to deploy the Report?

138