Hey all.

This is the query I'm trying to run:

select * from url_0, url_1, url_2 where url_0.url = 'http://google.com' or url_1.url  = 'http://google.com' or url_2.url  = 'http://google.com'

but it is returning things that are not http://google.com. why? how can I get it to only return entries that are exactly http://google.com? I have 62 tables to search.. is this the most efficient way to search them?

thanks!

What is the table structure you are using and are all 62 tables of the same design? Its hard to talk about efficiency without understanding how the tables are constructed.

What is the table structure you are using and are all 62 tables of the same design? Its hard to talk about efficiency without understanding how the tables are constructed.

Yeah, all 62 are of the same design, same structure, even the same fields (date, user, url, short_url).

t query more than one tabl e u should most likely be using join

would it not make more sense to have all this data in 1 table? if your table names are literally differentiated by a number, just add a field to your table structure. So instead of having 62 tables, have 1 table with the following fields:
date, user, url, short_url, TableNumber

Then you can have 1 simple, quick query to get what you need.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.