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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL bug or just I'm stupid?!? 1

Status
Not open for further replies.

strucnjak79

Programmer
Oct 14, 2005
37
BA
Well strange problem, When I try to join two tables I get no error but I get no results also! I use InnoDB and foreign keys, I dont know is there some problem whit that? MySQL is 4.1.18-max which goes with SUSE Enterprise Server 9!

this statement works (one table):

'SELECT T.id, T.name FROM tools AS T WHERE 1;'

This works fine of course, I know there is no need for 'AS T' I do this just to show you my problem!

I just add one more table, and it returns no result(?!?)
'SELECT T.id, T.name FROM tools AS T, cars AS C WHERE 1;'


Of course second query works on my second mysql server just great, with older version of MySQL (3.something...)

Any idea?
 
It seems there are no entries in your cars table.
If my guess is correct, you will have to re-think your understanding of table join.
regards
 
Of course there are entries in my car table but it doesen't metter be cause I select nothing from that table?!

Well this works in MySQL version 3.22 (I think it,s .22 but it's 3 for sure ;) but it doesen't work with 4.1.18! Is there some changes in version 4 which I dont know or what?
 
please run the following query and show us the results that it produces:
Code:
select 'tools',count(*) as c from tools
union all
select 'cars',count(*) from cars
union all
select 'both',count(*) from tools, cars

r937.com | rudy.ca
 
You are not following me dont you? ;) I told you it's not empty, on one server everything is ok, but on this one i have some problems... I'll try with another version of mysql as soon as I find some time!

 
you are right, i am not following you

the query that i asked you to run (above) shows that there are no rows in the cars table, and yet you say that there are

i'm sure how we can help you further



r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top