Quicker search

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
gld4x4
Forum Newbie
Posts: 8
Joined: Wed Feb 18, 2004 6:31 am

Quicker search

Post by gld4x4 »

:?: I have a database that has tables in it state, county, practice etc..

When I do a search I search by the above the request has to search through all the records in the database. Is there anyway I can I can do a search so it will only look at the records for that state?

Thanks
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Not following, is this different tables, or different fields?

If fields:

Code: Select all

select * from table where state = 'alabama'
If tables (kinda):

Code: Select all

select practice.* from practice inner join state on state.name = practise.state where state.name = 'alabama'
The later depends on what fields you are using aso aso...
Post Reply