Mysql Question...

Is there a limit to how many record "ID's" that can be pulled by a query?  If I have 435,000 records and I want to pull 12,000 records by their "ID" number what is the best way to do that with a mysql query?  I know the ID numbers just need a query to pull them...I tried the IN but I could not pull the full list...

Csampson
Quote · 25 May 2014

It depends.

Are the id's within a range?

If they are a bunch of random ID's that are not in a sequential order you may not be able to do it. All types of querys other than using IN have to be done with id's that are in a range. greater than, less than or limit starting from with count.

Technically there is no limit to the IN condition itself, but there is a limit to the packet size limits how long the IN condition can be.

https://www.deanbassett.com
Quote · 25 May 2014

No they are not in order they would be like this as a sample... WHERE `id` IN ( '43','255','340','349',  all the way to 12,000 numbers... What would be the best way to "tag" and or "call" these specific records...

Once tagged or called I can do what I need to do...I have a tag field but have no idea with that many records it takes days to do it the way I was tagging 1400 in 35,000 records which took only hours...I would just put something in the tag field then call it with a cut paste senareo...again I know the ID numbers of the records...

Csampson
Quote · 25 May 2014

Perhaps an editable PHP script that the ID's can be added?  

Csampson
Quote · 25 May 2014

Sorry. But with random numbers the IN condition appears to be the only way.

You might have to split it into multiple queries to shorten the IN condition and then combine the results.

https://www.deanbassett.com
Quote · 25 May 2014
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.