this is for the reporting
does someone knows?...
-
I want to add the row number as a column of the result set
this is for the reporting
does someone knows?
-
Re: I want to add the row number as a column of the result set
On 25 Apr 2007 21:39:39 -0700, hi and hello wrote:
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
-
Re: I want to add the row number as a column of the result set
On Apr 26, 5:27 pm, "Peter H. Coffin" <com> wrote:
>
> 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[/ref]
You can also do this:
mysql> set N = 0;
mysql> SELECT N := N +1 AS number, * FROM my_table;
-
Re: I want to add the row number as a column of the result set
On Apr 28, 2:44 pm, strawberry <com> wrote:
> [/ref]
>
>
>
> You can also do this:
>
> mysql> set N = 0;
> mysql> SELECT N := N +1 AS number, * FROM my_table;[/ref]
Actually, if using ' * ', then it has to come before the counter.
Also, you have to remember to reset N afterwards!
-
Re: I want to add the row number as a column of the result set
What you're asking for is "an un-natural act" in SQL. The point is
taht an SQL
Similar Threads
-
By Jay in forum ASP.NET Data Grid Control
Replies: 0
Last Post: August 28th, 07:47 PM
-
By Junaili Lie in forum Microsoft SQL / MS SQL Server
Replies: 4
Last Post: July 7th, 06:03 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks