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

Why do we use functions?

958


How to define output parameters in stored procedures?

1083


What is the difference between update lock and exclusive lock?

1028


Can you get second highest salary from the table?

1010


How to execute the cursor queries with "open" statements?

1242


What is a DBMS, query, SQL?

1095


What are the requirements to use odbc connections in php scripts?

1157


What is the benefit of normalization?

1135


What is for xml in sql server?

1140


Explain comment on transactions?

1041


How to enter binary string literals in ms sql server?

1213


How to restore performance issues and how to check?

2053


Explain ms sql server reporting services vs crystal reports?

975


What are extended events in sql server?

1009


What are the triggers in sql?

1168