vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| On 25 Apr 2007 21:39:39 -0700, hi and hello wrote: > this is for the reporting > does someone knows? Add an autoincrementing integer column. Use that. They make dandy primary keys as well. -- 53. If the beautiful princess that I capture says "I'll never marry you! Never, do you hear me, NEVER!!!", I will say "Oh well" and kill her. --Peter Anspach's list of things to do as an Evil Overlord |
| |||
| On Apr 26, 5:27 pm, "Peter H. Coffin" <hell...@ninehells.com> wrote: > On 25 Apr 2007 21:39:39 -0700, hi and hello wrote: > > > this is for the reporting > > does someone knows? > > Add an autoincrementing integer column. Use that. They make dandy > primary keys as well. > > -- > 53. If the beautiful princess that I capture says "I'll never marry you! > Never, do you hear me, NEVER!!!", I will say "Oh well" and kill her. > --Peter Anspach's list of things to do as an Evil Overlord You can also do this: mysql> set @N = 0; mysql> SELECT @N := @N +1 AS number, * FROM my_table; |
| |||
| On Apr 28, 2:44 pm, strawberry <zac.ca...@gmail.com> wrote: > On Apr 26, 5:27 pm, "Peter H. Coffin" <hell...@ninehells.com> wrote: > > > On 25 Apr 2007 21:39:39 -0700, hi and hello wrote: > > > > this is for the reporting > > > does someone knows? > > > Add an autoincrementing integer column. Use that. They make dandy > > primary keys as well. > > > -- > > 53. If the beautiful princess that I capture says "I'll never marry you! > > Never, do you hear me, NEVER!!!", I will say "Oh well" and kill her. > > --Peter Anspach's list of things to do as an Evil Overlord > > You can also do this: > > mysql> set @N = 0; > mysql> SELECT @N := @N +1 AS number, * FROM my_table; Actually, if using ' * ', then it has to come before the counter. Also, you have to remember to reset N afterwards! |