ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Maybe someone more MySQL-savvy can answer this for me. If I have a query:
SELECT `SomeField` FROM `SomeTable` WHERE `key`='value1' OR `key`='value2' OR `key`='value3';
I can run the query and get a result with 3 lines, but the results are arbitrarily ordered. Can I specify that I want the results in the order they are specified in the WHERE clause? (not necessarily using all those ORs, just as example)
first, i dont know your skill level with SQL, but i imagine you arent actually looking for the "ORDER BY" clause.
ive never used mySQL, and also its been a while since ive used SQL. however, i have read that without an ORDER BY clause, the order of the results is "undefined". that is, one implementation of SQL may returned the rows in the order they were inserted, while another one may return them in a randomized order (unlikely, but possible and for illustration purposes).
if you arent looking for the "ORDER BY" clause, and you want to force some "ORDER", then its obvious that you should be looking for "ORDER BY".
Maybe you can describe the problem that you're facing and we can think with you.
Without going into details, my problem goes something like this. Say I have a table with two columns:
where "Key" is a key (duh) and "HugeData" contains large BLOBs of data. I need to select a number of rows (could be 2, could be 1000) from the table, sort them according to some rules (which aren't in the database) and then display them in order. The sorting is recursive and I think shuffling around the HugeData values will create a bottleneck, so I do it in two steps: select the Keys (which are small), sort them, and then query again to select the HugeData in the order of the newly-sorted Keys.
The second query is what I'm asking about here. My current solution is to loop over the sorted keys and do one query each, but this is itself a bottleneck.