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

how to Update table Sales_summary with max(sales) data from
table sales_dataTable 1. sales_data table Table 2.
Sales_summary

Region sales Region sales
N 500 N 0
N 800 W 0
N 600
W 899
W 458
W 900

I want the Sales_summary After Update like this
Region Sales
N 800
W 900


Answer Posted / krishna

SQL> desc a;
Name Null? Type
------------------------------- -------- ----
A VARCHAR2(2)
B NUMBER(3)

SQL> select * from a;

A B
-- ---------
N 500
N 800
N 600
W 899
W 458
W 900

6 rows selected.

SQL> desc b;
Name Null? Type
------------------------------- -------- ----
A VARCHAR2(2)
B NUMBER(3)

SQL> select * from b;

no rows selected

SQL> insert into b (select a, max(b) from a group by a);

2 rows created.

SQL> select * from b;

A B
-- ---------
N 800
W 900

SQL>

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between local variables and global variables?

1071


What are transaction and its controls?

968


If a cursor is open, how can we find in a pl/sql block?

1105


What is an index? What are the types of indexes? How many clustered indexes can be created on a table?

994


how to delete an existing column in a table? : Sql dba

954


Can we create view in stored procedure?

910


what is a database transaction? : Sql dba

1108


how many values can the set function of mysql take? : Sql dba

935


What is a left inner join?

948


What do you understand by case manipulation functions?

954


What is sql scripting?

1037


What are the different set operators available in sql?

974


Why are cursors used?

1058


What is basic structure of pl sql?

990


Explain ttitle and btitle.

1058