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

hi every one.

select name,
case
when card_no like'4%' then 'visa'
when card_no like'5%' then 'master'
end result from account;

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are subqueries in sql server?

1130


what is the information that can be stored inside a bit column? : Sql server database administration

970


How retrieve field names from the table in SQL through JAVA code?

1915


How to drop existing views from a database in ms sql server?

1107


What is report subscription?

128


What is table valued function and scalar valued functions?

1097


How can you hide the sql server instances?

1025


Explain alternate key, candidate key and composite key in sql server?

917


How to truncate the log in sql server 2012? : sql server database administration

1298


What is the difference between locking and multi-versioning?

994


How to find which stored procedure is currently running in sql server?

997


What does it mean to normalize a database and why would you do it?

984


What is the difference between delete and truncate statements?

1085


What are various limitations of the views?

1058


What are the components of dbms?

955