Re: SELECT and LIMIT question

2004-10-14 Thread SGreen
There is a HUGE limit on the size of the results of a query but I don't know exactly what yours will be. I do know it should be more than 2GB so I don't think your 4500 fields of data (300X15) will meet that limit. However, there is a practical limit on how many queries can be UNIONed into one

Re: SELECT and LIMIT question

2004-10-14 Thread Jay K
Works great. Is the a limit on the size of the query. There are currently 50 queries (may go upto 300 in future) and each has 15 cols (250b each query) which makes the entire query 12kb (250 x 50). Thanks, Jay --- Michael Stassen <[EMAIL PROTECTED]> wrote: > Right. > > (SELECT col1, col2,

Re: SELECT and LIMIT question

2004-10-14 Thread Michael Stassen
Right. (SELECT col1, col2, col3, col4 FROM table1, table2 WHERE table1.col1 = table2.col1 and table1.col2 = 1 ORDER BY col3 DESC LIMIT 5) UNION (SELECT col1, col2, col3, col4 FROM table1, table2 WHERE table1.col1 = table2.col1 and table1.col2 = 2 ORDER BY col3 DESC LIMIT 5)

Re: SELECT and LIMIT question

2004-10-14 Thread SGreen
I believe you need to combine the results of 3 separate queries (each with a limit of 5) into a temp table and respond with the contents of the table you built. If I read this correctly (http://dev.mysql.com/doc/mysql/en/UNION.html) you could do the same thing with a UNION query and skip the t

Re: SELECT and LIMIT question

2004-10-13 Thread Jay K
Yes. I want to retrieve 5 of each. If I put LIMIT 5, the entire query retrieves only 5 for table1.col2 with value of 1 because 1 is the first in the IN (1,2,3) clause. If I put LIMIT 15, the query returns 15 rows same as above instead 5 for each 1, 2, and 3 values. This is because there are more

Re: SELECT and LIMIT question

2004-10-13 Thread Michael Stassen
Why do you think it doesn't work with LIMIT? Do you want 5 of each? Michael Jay K wrote: Hi, I have multiple queries like this: SELECT col1, col2, col3, col4 FROM table1, table2 where table1.col1 = table2.col1 and table1.col2 = 1 ORDER BY col3 desc LIMIT 5 and SELECT col1, col2, col3, col4 FROM ta

Re: Select and Limit

2004-03-17 Thread Michael T. Babcock
Egor Egorov wrote: Yes, use LIMIT clause to get only certain number of rows. For example, to retrieve forst 10 rows use the following statement: SELECT .. FROM .. ORDER BY .. LIMIT 0,10; Then to retrieve next 10 rows: SELECT .. FROM .. ORDER BY .. LIMIT 10,10; retrieve rows 11-20

Re: Select and Limit

2004-03-11 Thread Egor Egorov
"Keith Wilson (www.giraffedog.net)" <[EMAIL PROTECTED]> wrote: > I am trying to split the results from a select query across several pages. > > I have a contacts database and if someone searches for a contact who has a > name like %mith% I want it to return the results with a page across the > bot

Select and Limit

2004-03-11 Thread Keith Wilson (www.giraffedog.net)
I am trying to split the results from a select query across several pages. I have a contacts database and if someone searches for a contact who has a name like %mith% I want it to return the results with a page across the bottom, like google. How do I do this with mySQL and ASP or PHP? I understa