[snip]
mysql> set @a:=0;
Query OK, 0 rows affected (0.00 sec)
mysql> select @a:[EMAIL PROTECTED],mod(@a,2),ordr_ID, poft_Sub_Month from
er_poft
group by 3,4 having mod(@a,2) = 0 limit 5;
+--+---+-++
| @a:[EMAIL PROTECTED] | mod(@a,2) | ordr_ID | poft_Sub_M
--+
5 rows in set (0.00 sec)
-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 27, 2005 8:50 AM
To: Alessandro Sappia; mysql@lists.mysql.com
Subject: RE: How to select every second record
[snip]
Jay Blanchard wrote:
> [snip]
> Is it possib
[snip]
Jay Blanchard wrote:
> [snip]
> Is it possible to select only every second record from a record set?
>
> I should select the record-number 1, 3, 5, 7, 9, ... or record-number
2,
> 4,
> 6, 8, ...
>
> Can this be done with LIMIT?
> [/snip]
>
> Not LIMIT, but you can use MOD, especially wi
[snip]
Is it possible to select only every second record from a record set?
I should select the record-number 1, 3, 5, 7, 9, ... or record-number 2,
4,
6, 8, ...
Can this be done with LIMIT?
[/snip]
Not LIMIT, but you can use MOD, especially with an auto-increment field
(id in this case is the
Hello,
> Is it possible to select only every second record from a record set?
>
> I should select the record-number 1, 3, 5, 7, 9, ... or record-number 2,
4,
> 6, 8, ...
>
> Can this be done with LIMIT?
Besides the obvious "why?" ...
A table, by itself, does not have "every second record", as it