Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to call a mysql row without id? 3

Status
Not open for further replies.

AcidReignX

Programmer
Feb 28, 2005
32
US
I'm trying to set up a program where I will have many entries with rows, and they will all be assigned id numbers. However, some of those rows will be removed, and the id numbers will not decrease (which is good because I don't want them to). However, I DO want to know how I can call on a row number without searching for the id that is set for auto_increment.

How might I do that?

 
You would need to match other values in the row.

select * from table where field1='a' and field2 = 'b' and field3 = 4



Bastien

I wish my computer would do what I want it to do,
instead of what I tell it to do...
 
I see... so I take it there is no way to call it simply by rows then.. :(

Well, thanks for the update.
 
Er.. well, like if I wanted to call tables randomly, but the id's were messed up.. for example if the rows were like this:

id | name | other
00 | John | misc
01 | Mary | misc
04 | Fred | misc
06 | Jack | misc

How could I randomly select something between those based on their position rather than the id?
 
Technically speaking, there is no "between" among records in a relational database. The records in a relational database are modelled after the mathematical concept of a set, which imposes no order on the elements.

You impose an order on a set of records only during your SELECT query when you issue an ORDER BY query.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top