User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 426,416 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,310 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser: Programming Forums
Views: 1605 | Replies: 1
Reply
Join Date: Nov 2006
Location: Mumbai
Posts: 10
Reputation: freakin_chris is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
freakin_chris's Avatar
freakin_chris freakin_chris is offline Offline
Newbie Poster

Help sql syntax - Copy table

  #1  
Jan 26th, 2008
Can anyone please tell me how can i copy a table.

thank you.

and also how to fin out the second highest value of a field in a table. eg. select the employee cashing in the second highest salary in the company.



Thanks a lot.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2008
Posts: 1
Reputation: TheSQLMan is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
TheSQLMan TheSQLMan is offline Offline
Newbie Poster

Re: sql syntax - Copy table

  #2  
Jan 26th, 2008
You can select the second highest value using a subquery:
select top 1 * from
(select top 2 * from employee order by salary desc) as tmp
order by tmp.salary
--------------------
http://www.ahewd.com
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MS SQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MS SQL Forum

All times are GMT -4. The time now is 1:52 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC