Click here to Skip to main content
15,893,486 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
select * from emp m where(select COUNT(distinct salary) from emp s where s.salary>m.salary)=0




can any one tell me what is the execution flow

[edit]code block fixed[/edit]
Posted
Updated 15-Dec-12 22:14pm
v2

In SQL Server Management Studio, you can show the execution plan. Click Ctrl+M, or from the menu, choose 'Query|Include Actual Execution Plan'.

This will vary depending on your table structure (which indexes are available), your table contents (statistics), your server hardware (RAM, number of CPUs), and your server load (the server will invest more resources building a plan if more resources are available).

So the only one who can tell what is the execution plan is you.

Good luck,
Pablo.
 
Share this answer
 
Comments
Abhishek Pant 18-Dec-12 2:30am    
Perfect,+5
I think that you can use MAX function...

For Example:
Select MAX(coloumn_name) from table_name;

Thanks.
 
Share this answer
 
Comments
Sk. Tajbir 16-Dec-12 14:16pm    
5+
You can use this query with Max function like Mr. Tarun said,
SQL
select * from emp where salary = (select Max(salary) from emp)


This is will give you a list of employees who have highest salary.

I hope this will work.
Thanks :)
 
Share this answer
 
Comments
Tarun Mangukiya 16-Dec-12 23:24pm    
Ya.
The same Query we can use.
But I can't suggest him because he has to learn all this himself.
So, I just gave an example...

Thanks.
Sk. Tajbir 17-Dec-12 2:07am    
ok :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900