Hi,
I'm running this in the mysql command line shell.
If I run
Code:
select * from cashback where user_id=1912;
I get 1037 rows in set (0.01 sec)
But if I order by the epi_report_id column ie.
Code:
select * from cashback where user_id=1912 order by epi_report_id;
I get 1204 rows in set (0.02 sec)
Please can someone explain why sorting by a column should effect the number of rows returned...?
I also noticed that if I count the rows I do get the same result each time, i.e.
Code:
mysql> select count(*) as count from cashback where user_id=1912 order by epi_report_id;
+-------+
| count |
+-------+
| 1037 |
+-------+
1 row in set (0.00 sec)
and
Code:
mysql> select count(*) as count from cashback where user_id=1912;
+-------+
| count |
+-------+
| 1037 |
+-------+
1 row in set (0.00 sec)
Just incase you think the structure of the table could be effecting things here it is:
Code:
mysql> describe cashback;
+---------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+---------------+------+-----+---------+----------------+
| cashback_id | int(11) | | PRI | NULL | auto_increment |
| user_id | int(11) | | MUL | 0 | |
| epi_report_id | int(11) | | MUL | 0 | |
| payout | float | | | 0 | |
| paid | enum('0','1') | | MUL | 0 | |
| reversed | enum('0','1') | | MUL | 0 | |
| revdate | int(11) | | | 0 | |
+---------------+---------------+------+-----+---------+----------------+
7 rows in set (0.00 sec)
Thanks,
Tom
Bookmarks