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 is the use of set nocount on/off statement?

1074


How to delete duplicate rows?

970


Where are stored procedures in sql server?

1048


What are the benefits of filtered indexes?

1020


How to choose all records from the table?

1039


How to find the version of sql server? : sql server database administration

1087


What is a filestream?

970


What to check if a User database is locked?

1049


Write a sql query to delete duplicate records from a table called table1

1009


What is the difference between join and inner join?

995


Explain what is cte (common table expression)?

1106


what are the different types of replication you can set up in sql server? : Sql server database administration

1009


What are views in ms sql server?

1058


How can a user-defined datatype be created?

971


Explain the etl (extraction, transformation, and loading)?

976