473,715 Members | 6,082 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

LIMIT modifier

I'm dealing with a project that requires me to query a MS SQL Server. Not
a PostgreSQL issue I know but I want to ask if the LIMIT modifier is SQL
standard? MS SQL Server uses a TOP modifier.

select top 1 * from xxx;

Whereas all the SQL RDBMS' I've used before used

select * from xxx limit 1;

Any enlightenment is appreciated. (I'm putting notes in the code to
reflect the non-standard stuff I've had to deal with.)
TIA,
Rod
--
"Open Source Software - You usually get more than you pay for..."
"Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL"

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #1
3 2690
Rod,

Have a look at the bottom of this page:
http://www.postgresql.org/docs/curre...ql-select.html

"Nonstandar d Clauses

The clauses DISTINCT ON, LIMIT, and OFFSET are not defined in the SQL
standard."

TOP x isn't in the standard as well, afaik.

Best regards,

Arjen

Roderick A. Anderson wrote:
I'm dealing with a project that requires me to query a MS SQL Server. Not
a PostgreSQL issue I know but I want to ask if the LIMIT modifier is SQL
standard? MS SQL Server uses a TOP modifier.

select top 1 * from xxx;

Whereas all the SQL RDBMS' I've used before used

select * from xxx limit 1;

Any enlightenment is appreciated. (I'm putting notes in the code to
reflect the non-standard stuff I've had to deal with.)
TIA,
Rod



---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 12 '05 #2
On Mon, 15 Dec 2003, Arjen van der Meijden wrote:
"Nonstandar d Clauses

The clauses DISTINCT ON, LIMIT, and OFFSET are not defined in the SQL
standard."
Humm. Is there a SQL standard to return a subset of the selected tuples?
This being contrary to relational theory I believe. :-)
TOP x isn't in the standard as well, afaik.


I had no doubts there.
Thanks,
Rod
--
"Open Source Software - You usually get more than you pay for..."
"Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL"

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org

Nov 12 '05 #3
On Mon, 15 Dec 2003 09:32:34 -0800, Roderick A. Anderson wrote:
want to ask if the LIMIT modifier is SQL standard?
No. The standard doesn't have anything like that, unfortunately.
MS SQL Server uses a TOP modifier.


Yes, but it accepts an optional "WITH TIES" modifier which PostgreSQL
doesn't have.

See also:
http://troels.arvin.dk/db/rdbms/#select-limit

--
Greetings from Troels Arvin, Copenhagen, Denmark

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1809
by: steve | last post by:
Can someone give me an example of using the ’e’ pattern modifier in php regex: http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php Thanks in advance. Wish the manual had some examples on this one! -- Posted using the http://www.dbforumz.com interface, at author's request Articles individually checked for conformance to usenet standards Topic URL: http://www.dbforumz.com/PHP-pattern-modifier-ftopict233538.html
2
3552
by: Dan Disney | last post by:
I have read conflicting information on the access scope of VB.Net class declarations when no access modifier is specified. MSDN library documentation states "Classes that do not specify an access modifier are declared as Friend by default" However, another source, VB.Net Class Design Handbook by Wrox Press states that no a "no class access modifier results in an implicit scope of public to all assemblies". In fact, if I create a class...
3
1798
by: N Khan via .NET 247 | last post by:
Hi, I know the usage of access modifier ?public? in DLL assembliesbut I am a bit puzzled that if let say I have a public class inan exe assembly then what purpose access modifier ?public? willserver. Related to the same thing is it possible that we canexpose exe assembly like DLL assembly. Cheers ----------------------- Posted by a user from .NET 247 (http://www.dotnet247.com/) <Id>p7rsZMJSYEKKt7NbDTtJeA==</Id>
3
1396
by: fh1996 | last post by:
Documents say that "new" class modifier is only used with nested classes. "new" indicates that the class hides an inherited member of the same name." public class MyDerivedC : MyBaseC { new public void Invoke() {} } The only thing I don't understand in the above statement and example is that it says that "new" only used with nested classes. However the example isn't
3
256
by: Aaron | last post by:
Hi, I am attempting to alter the behaviour of a base class using the new modifier. I have hit a snag and am unable to hide the base class member. The skeleton code is below, I have included an override class derivation as well that does hide the member, why override does and new doesn't I am not sure? using System;
1
5591
by: Mark Kamoski | last post by:
Hi-- Please help. What is the default access modifier value for a Sub or a Function when one has not explicitly been set. In MSDN, in "Access Types", it states... "If no access modifier has been specified, the default access type depends
7
5388
by: Alan Foxmore | last post by:
I understand about public, internal, protected, etc. Is there a way to ensure members are accessible within the same namespace only? In other words, I want to prohibit access to members outside the namespace. Can this be done? I don't think so. Thanks -- Alan Foxmore
10
3303
by: =?iso-8859-2?B?SmFuIFJpbmdvuQ==?= | last post by:
Hello everybody, this is my first post to a newsgroup at all. I would like to get some feedback on one proposal I am thinking about: --- begin of proposal --- Proposal to add signed/unsigned modifier to class declarations to next revision of C++ programming language
1
1832
by: muler | last post by:
"If an instance method declaration includes the sealed modifier, it must also include the override modifier." The C# Programming Language, § 10.5.5 Sealed Methods Why is this? Thanks, Mulugeta
1
9104
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9047
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7973
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6646
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5967
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4477
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3175
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2541
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2119
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.