View Single Post

   
  #2 (permalink)  
Old 03-17-2008, 06:13 AM
Erick T. Barkhuis
 
Posts: n/a
Default Re: is there a goto instruction in mysql?

moses:

> hi guys, i am doin a project in HPC.


High Performance Computer, Handheld PC, or something else?


> i am just a beginner in databases.
> so i just wanna know if there is any function in SQL which
> lets me to jump to a particular record directly.say something like
> 'gotorecord' or somethin...


I'm afraid you're completely on the wrong track (or I am misunderstanding
your question). Databases are used to store, filter and retrieve data.

In a database, you don't "jump to a record". Of course, your
_application_ may retrieve a record from the database, and do whatever
you want it to do with that set of data.

Perhaps (I'm just guessing here) you want to process all 'records' from a
table, starting from a certain value upwards. As in: "return all sales in
recent years, starting from the year 2005".
If that's what you want, use the WHERE clause of the SELECT statement to
specify the range, and the ORDER BY clause to get the result in a proper
order. You application will then loop through the result.

--
Erick

"Given a conflict, Murphy's law supercedes Newton's."

Reply With Quote