lawnmowerman
Banned
- Joined
- Aug 17, 2004
- Messages
- 11,073
- Reaction score
- 1,014
I see, I am calling my row_number function based on ID, which is set as primary key. Does it still have the problem that you mentioned?In real world, the ID column in the database may not necessary be in running order, due to unforseen database issue or other reasons. Another possibility could be someone might have deleted a particular row data intentionally, accidentally or for whatever reason. For example, try delete row 3 with ID 3 and you will see the effect.
One work around is to include the MySQL (if this is the database you are using) row_number() in your SQL query statement and use that sequential value. example:
SELECT row_number(), ID, data FROM mytable
BTW my ID is very small. Less than 25 per set. I will assign multiple set of less than 25 data. How should I go about it assignment the set.?
That means, I have a table, let say 25 rows. I want to replicate the table structure, over and over again with different data sets. How should I go about it doing it in mysql. I have one table only now.
Let say, I want to have multiple tables based on day. How do I link this table based on date.? Everyday one table.