•
•
•
•
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 425,822 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,990 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: 918 | Replies: 1
![]() |
You will need to be able to order the data in some way.
Say you have a table T storing people birthdays with two following columns: personId, birthdayDate.
To delete 5 top rows from that table you could do
I don't know if there is a better way of doing this.
Say you have a table T storing people birthdays with two following columns: personId, birthdayDate.
To delete 5 top rows from that table you could do
sql Syntax (Toggle Plain Text)
DELETE FROM T WHERE personId IN (SELECT top 5 personId FROM T ORDER BY personId)
I don't know if there is a better way of doing this.
![]() |
•
•
•
•
•
•
•
•
DaniWeb MS SQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Firefox Compatibility help with script (JavaScript / DHTML / AJAX)
- Open In New Window Php (PHP)
- mysql_num_rows(): supplied argument is not a valid MySQL result resource (PHP)
- MySQL Checkbox Multiple data Delete? (PHP)
- New to php and need some help with a guestbook (PHP)
- Having prolems with a guestbook (HTML and CSS)
- passing parameter to Store Procedure in SqlDataAdapter (VB.NET)
- Form not sending email (PHP)
- Custom Database Admin Tool. (PHP)
Other Threads in the MS SQL Forum
- Previous Thread: How To get the 5th row from a table.
- Next Thread: Problems Joining Query


Linear Mode