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 get the maximum among two tables,for example table 1
(dep1) have (emp_id,emp_name,salary) columns and table 2
(dept2) have (emp_id,emp_name,salary) columns,i want which
employee have the maximum salary among two tables?

Answer Posted / sumathy

Use Cursors:

declare Cursor_Name cursor scroll
for
select max(salary) as salary from dep1
union
select max(salary) as salart from dep2 order by salary desc
open Cursor_Name
fetch absolute 1 from Cursor_Name
deallocate Cursor_Name

Is This Answer Correct ?    13 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is efficiency data?

1002


Explain how to maintain a fill factor in existing indexes?

1035


Give a example to search fr a string in all stored procedure in sql server.

1059


explain extended properties

1036


What are the acid properties?

1057


Are all views updatable ?

1199


Can group functions be mixed with non-group selection fields in ms sql server?

994


What are the reporting services components?

144


Define compound operators?

964


What is Fragmentation and Defragmentation? For 32GB Table,How can we do the fragmentation?

4453


How to start sql server browser service?

1180


What does dml stand for?

994


Tell me what is log shipping?

1029


Explain the creation and execution of a user-defined function in the sql server?

1111


Can you tell me about the concept of ER diagrams?

1121