Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 How do I write this

Author  Topic 

Dallr
Yak Posting Veteran

87 Posts

Posted - 2008-04-15 : 13:03:56
Good Afternoon all,
I was wondering how to write the TOP 5 records using Relational Algebra.

Dallr

nr
SQLTeam MVY

12543 Posts

Posted - 2008-04-15 : 13:52:23
Don't think you can.
top 5 implies an ordering of the set whereas sets are unordered.


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

Dallr
Yak Posting Veteran

87 Posts

Posted - 2008-04-15 : 19:08:34
Ok thanks for the reply.

Next question, how it is that i did not get an email response to this post notifying me that someone had responded.

dallr
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-15 : 19:11:01
Did you subscribe to this thread? My subscriptions are working fine so I know the process is working. If you are subscribed, then I'd suggest checking your profile to ensure your email address is correct.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Dallr
Yak Posting Veteran

87 Posts

Posted - 2008-04-15 : 19:59:38
Ok thanks I will check.
Go to Top of Page

Dallr
Yak Posting Veteran

87 Posts

Posted - 2008-04-16 : 15:59:44
One more question. How would you get the TOP 5 records in oracle? Someone told me that Oracle does not use TOP.

Dane
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2008-04-16 : 16:02:02
where rownum <= 5

I think - something like that anyway

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -