473,659 Members | 2,646 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to LIMIT results in an html php/sql query?

Hi,

I need to limit results in the following query type:

http://www.somewhere.com/php/sql-a.p...l_order=&pos=1

I found a reference that says I should be able to use LIMIT x[,y], but
I don't know where/exactly how to add that to the string. Once I know
what it's supposed to look like, and can write something to generate
it.

If someone could post an example using the above and limiting the
output to 100 records starting at position 1, that would be great.

Aug 11 '05 #1
1 5064
LIMIT isn't a standard SQL feature. It is supported by MySQL but not SQL
Server.

Take a look at the following alternative solutions:
http://www.aspfaq.com/show.asp?id=2120

--
David Portas
SQL Server MVP
--
Aug 11 '05 #2

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

Similar topics

3
17314
by: Brian Piotrowski | last post by:
Hi All, I'm trying to run a simple query from an ASP page. I want the query to select each individual field in a table and compare it to another table. If the value doesn't exist, I want it reported. Here's the code I have to do this check: 'Check to see if there are any assemblies not in the database! strSQL = "select substring(mtoc,2,6) as deadmodel from bos_data where substring(bos_data.mtoc,2,6) not in (select code from...
0
1784
by: krystoffff | last post by:
Hi I would like to paginate the results of a query on several pages. So I use a query with a limit X offset Y to display X results on a page, ok. But for the first page, I need to run the same query with a count(*) to know how many pages I will get (number total of rows/ X). The problem is my query is very slow (maybe 5s) because there is much
5
2675
by: Nick | last post by:
Is there a (better) way to get the toal number of results from a query but still limit them with a LIMIT clause. For example, in a Google search result, it displays 1-100 of 10,000,000 results. Do they hit the database once for results, and again for a total count or is it all in one query? Thanks -Nick
4
3304
by: emily_g107 | last post by:
Hi, I need to limit results in the following query type: http://www.somewhere.com/php/sql-a.php3?server=1&db=mydatabase&table=mytable&sql_query=SELECT+Field_1%2CField_2%2CField_3%2Cidno+from+mytable+where+1+and+field_1+like+%22string%22+&sql_order=&pos=1 I found a reference that says I should be able to use LIMIT x, but I don't know where/exactly how to add that to the string. Once I know what it's supposed to look like, and can...
0
5776
by: D. Dante Lorenso | last post by:
I need to know that original number of rows that WOULD have been returned by a SELECT statement if the LIMIT / OFFSET where not present in the statement. Is there a way to get this data from PG ? SELECT ... ; ----> returns 100,000 rows
9
10835
by: Terry E Dow | last post by:
Howdy, I am having trouble with the objectCategory=group member.Count attribute. I get one of three counts, a number between 1-999, no member (does not contain member property), or 0. Using LDIFDE as a comparison I get the same results. No members means just that, an empty group. Zero means that the DirectorySearcher.SizeLimit has been exceeded....
5
4746
by: - | last post by:
I have only 1m records in my database running on a laptop of speed 1.6GHz, memory 512MB ram, and Toshiba MK8032GAX hard disk. I use 'LIMIT x,10' for the query to utilise record paging. When the value of x is nearer to 0, the query speed is fast. Presently, 'LIMIT 0,10', 'LIMIT 50000,10' and 'LIMIT 100000,10' takes about 0sec, 11secs and 4mins respectively. 1) Is there anything I should do, in terms of sql statement or database design,...
3
5688
by: jon | last post by:
Please Excuse the newbie question, but I have not been able to figure out how to do the following on my own. Assume I have a table called 'reviews' and in that table there are three columns: reviewDateTime, reviewID, and reviewItem. reviewItem is not unique, the other two are. What I want to do in pseudo-code is write a select query that will: for each unique reviewItem select 5 reviewID by reviewDateTime ascending
1
14910
by: woony | last post by:
I am making a webpage that gets his information from an as400 system. Now I seemed to hit some weird problem. I have for example this select: select field1,field2 from table this is over 25.000 results. and works perfectly now the second I add a where clause
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8751
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8535
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
8629
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
7360
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...
0
5650
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
4338
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2757
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
1739
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.