Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple sql select does not return the correct number of rows

Status
Not open for further replies.

JoLiang

Programmer
May 5, 2004
4
US
I have 2668 rows in my table.

select count(distinct ID) from mytable;

gives the following results: 2668

However, when I use:

select ID from uniprot;

I only get 1000 rows returned, what could be the problem?

I use windows xp 1 GB ram, and mysql 4.0.18

Any help is appreciated.

 
Try:
select ID from uniprot limit 2000;

Your query tool (possible MySQL Control Center) limits your results to 1000 (to prevent hangs on huge result sets).
If you are using MySQL CC you can change this in the Options.


"If you always do what you've always done, you will always be where you've always been."
 
Are you by any chance using MySQL Control Centre?

If so, open the program, select the server, click the Edit button, click the MySQL Options tab, and set the "Automatically limit SELECT queries to" field to 0, meaning no limit.

-----
ALTER world DROP injustice, ADD peace;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top