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 / 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


Please Help Members By Posting Answers For Below Questions

Tell me about normalization in DBMS.

983


What are the types of database recovery models?

1101


Do you know what is user defined datatypes and when you should go for them?

949


What is the difference between functions and stored procedures?

1137


How to turn off warning messages during php execution?

1023


What is the Disadvantage of indexed sequential file.

1064


where the connection string store in the database

2052


Explain about protocol layer present in SQL server?

1177


How does recursive cte works in sql server?

987


What is store procedure? How do they work? When do you use?

919


How to enforce security in sql server? : sql server security

1076


How should i optimize the time for execution of stored procedure having single input and many output from the different tables?

1892


Describe different Processing Modes offered by SSRS?

246


What is pivot and unpivot?

997


What are the grouping functions?

920