limit

LIMITing an SQL JOIN

Hi there, I am trying to limit the following SQL statement. SELECT expense.*, transaction.* FROM expense INNER JOIN transaction ON expense_id = transaction_expense_id What I want to do, is limit the number of 'parent' rows. IE. if I do a LIMIT 1, I would receive only one expense item, but still get all transactions associated with it....

Efficient Paging (Limit) Query in SQLServer 2000?

What would be the most efficient way to do a paging query in SQLServer 2000? Where a "paging query" would be the equivalent of using the LIMIT statement in MySQL. EDIT: Could a stored procedure be more efficient than any set based query in that case? ...

Rewriting a MySQL query

I'll try to explain this better on another question. This is the query that I think should work but, off course, MySQL doesn't support this specific subselect query: select * from articles a where a.article_id in (select f.article_id from articles f where f.category_id = a.category_id order by f.is_stic...

Problems with running an application under controlled environment (Win32).

I'm not exactly sure how to tag this question or how to write the title... so if anyone has a better idea, please edit it! Here's the deal: Some time ago I had written a little but cruicial part of a computing olympiad management system. The system's job is to get submissions from participants (code files), compile them, run them again...

Can I limit users to a specific range and zoom level on Google Maps?

I'm implementing a Google Map on a web-page. For the purpose of this project, I want to limit how far users can drag the map, so that they can only view a certain area that falls within two co-ordinates (one specifies north-west, the other, south-east, if you get my meaning). What's the best way to implement this using the Google Maps A...

Optimizing "ORDER BY" when the result set is very large and it can't be ordered by an index

How can I make an ORDER BY clause with a small LIMIT (ie 20 rows at a time) return quickly, when I can't use an index to satisfy the ordering of rows? Let's say I would like to retrieve a certain number of titles from a table 'node' (simplified below). I'm using MySQL by the way. node_ID INT(11) NOT NULL auto_increment, node_title VAR...

Limit fetch size of Net::HTTP.request_get

I want to fetch some content from a webserver using Net:HTTP, like this: url = URI.parse('http://www.example.com/index.html') res = Net::HTTP.start(url.host, url.port) {|http| http.get('/index.html') } puts res.body But I need to limit the get to the first 5kb to reduce the network traffic. How do I do this? ...

hitting the 2100 parameter limit (sql-server) when using Contains()

from f in CUSTOMERS where depts.Contains(f.DEPT_ID) select f.NAME depts is a list (IEnumerable<int>) of department ids this query works fine until you pass a large list (say around 3000 dept ids) .. then i get this error: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Too many parameter...

LIMIT in FoxPro

I am attempting to pull ALOT of data from a fox pro database, work with it and insert it into a mysql db. It is too much to do all at once so want to do it in batches of say 10 000 records. What is the equivalent to LIMIT 5, 10 in Fox Pro SQL, would like a select statement like select name, address from people limit 5, 10; ie only ...

Limit the size of List(Of T) - VB.NET

Hello I am trying to limit the size of my generic list so that after it contains a certain amount of values it wont add any more. I am trying to do this using the Capacity property of the List object but this does not seem to work. Dim slotDates As New List(Of Date) slotDates.Capacity = 7 How would people advice limi...

How many RewriteRules can you have in .htaccess without trouble?

Simple question. Is there a limit as to how many RewriteRules I can have in my .htaccess or can I put a zillion of them in there without Apache going all funky on me? Is there a relative limit where the server simply dives because there are to many rules to iterate through? Thanks! ...

How to get the top record from SQL Server Compact Edition?

I've tried select top 1 * from tbl select top(1) * from tbl select * from tbl limit 1 Nothing worked. Does SQL Server Compact Edition support getting the top x rows? ...

C# Typeresticted delegate with Template

The .net EventHandler is limited to Templates that inherits from EventArgs. How is that done? The implementation (Got to refference in vs) shows the following code: [Serializable] public delegate void EventHandler<TEventArgs>(object sender, TEventArgs e); But i think TEventArgs is just a name. How can I write a typed delegate that is...

What is a maximum number of arguments in a Python function?

It's somewhat common knowledge that Python functions can have a maximum of 256 arguments. What I'm curious to know is if this limit applies to *args and **kwargs when they're unrolled in the following manner: items = [1,2,3,4,5,6] def do_something(*items): pass I ask because, hypothetically, there might be cases where a list lar...

PHP - Maximum Total Upload Size?

I have a php web page with 15 fields. The user will use it to upload images. I tested this by uploading 15 jpg images, each about 2 M, without any problems. On the day I launch, I will be moving this web page to another Linux shared hosting environment (still not sure which). Are there some web hosting environments that limit the si...

Is a GROUP BY on UNIQUE key calculates all the groups before applying LIMIT clause?

If I GROUP BY on a unique key, and apply a LIMIT clause to the query, will all the groups be calculated before the limit is applied? If I have hundred records in the table (each has a unique key), Will I have 100 records in the temporary table created (for the GROUP BY) before a LIMIT is applied? A case study why I need this: Take ...

sql limiting for unique records

I have a table that may have about 100 records or so, with a user name field. There may be many records with the same username. How would I ensure that only one record for each username is returned, regardless of which record it is? e.g. for the following table users username item firstname lastname -------------------------------...

When ASUTIME LIMIT is met for DB2 stored procedures, will the process ROLLBACK or COMMIT?

Can't find any answers on the net, has anyone tried this? My stored proc processes deletion of tokens found across multiple tables and it is set to run for a specified number of "cpu service units" by using the ASUTIME LIMIT integer stored proc definition/characteristic. When this limit is met, will the stored proc commit or rollback th...

How to programatically limit bandwidth usage of my c# windows forms application

Hi, I've got a backup application here which connects to various webservices and downloads/uploads files from ftp or http servers. What is the easiest way to limit the bandwidth usage of my application? I need to do that because the application once installed and running will be slowing down internet access for all office people, which...

How can I programmatically remove the 2 connection limit in WebClient

Those "fine" RFCs mandate from every RFC-client that they beware of not using more than 2 connections per host... Microsoft implemented this in WebClient. I know that it can be turned off with App.config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.net> <connectionManagement> <add address="*" maxconnecti...