MySQL Forums
Forum List  »  Newbie

Re: Iterating through SQL table
Posted by: K R
Date: April 26, 2009 01:06PM

Thank you very much for your answer! I read a bit about the LIMIT clause. It really seams to solve my problem, but it still creates another I think. I suppose you consider using a loop which asks for say 10000 results at a time, But wouldn't SQL execute the query each time and after that extract the correct entries of the result set? It would be quite time consuming, wouldn't it?

Es for primary keys, my table does have them, but they are actually hash values constructed automatically by my java code, that is I don't know what they are. I have no idea how one could ask "foreach PRIMARY KEY".




I decided to describe my situation in more detail, if my question is too vague:
My table looks like as follows:

hashvalue (int, Primary Key) | DocIDs (text) | count (int)

DocIDs MUST be a text, because it contains all docIDs separated by ";" which contain the same hashvalue, count is the number of DocIDs in column 2.

In my next step I want to take each entry in DocIDs where count > 1 and manipulate it in java (something not concerning databases). I do not need to compare different entries of the result set,


Actually I need to execute the following statement:

SELECT `DocIDs` FROM `IndexTable`WHERE `count` > 1;

But the data set is too big for a private PC, that's why I get all my problems.



Edited 4 time(s). Last edit at 04/26/2009 01:43PM by K R.

Options: ReplyQuote


Subject
Written By
Posted
K R
April 18, 2009 01:10PM
Re: Iterating through SQL table
K R
April 26, 2009 01:06PM
K R
April 26, 2009 11:14PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.