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

Explain the categories of stored procedure?

979


What is built-in/administrator?

1073


When a primary key constraint is included in a table, what other constraints does this imply?

1020


How to recompile stored procedure at run time?

1116


do you know how to configure db2 side of the application? : Sql server database administration

1097


How to select an exiting database using mssql_select_db()?

1048


Do you know clustered and non-clustered index?

1021


What is partitioned view?

960


Is sql server difficult to learn?

968


What is use of @@ spid in sql server?

1271


Can we install sql server 2016 on windows 7?

1196


What do you understand by user-defined function in the sql server?

1009


Which tcl commands are available on the sql server?

1139


Can we return Data from 4(more than 1) tables in stored procedure?

1107


What are the advantages of passing name-value pairs as parameters?

1215