Go Back   CodingForums.com > :: Server side development > MySQL > Other Databases

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-13-2006, 02:37 PM   PM User | #1
daraptor
New Coder

 
Join Date: Dec 2006
Posts: 41
Thanks: 6
Thanked 0 Times in 0 Posts
daraptor has a little shameless behaviour in the past
help with query

hey guyz...am a newbie to sql....
i got this table in MS access which has got all the airport codes.........
the name of the table is Airport_codes...
the column names in the table are.....Airport_code, Airport_name, State, Country......so my problem is what would be the query to get any airport code.....for example
when i type cmh in the search box it should bring up port columbus intl airport .....
like this i should be able to bring up any airport code jss by typin the code in the search box....i hope u got my point....i know this is a dumb question...but am a newbie...am quite confused...hope someone will help me out with this.....thanx guyz......
daraptor is offline   Reply With Quote
Old 12-13-2006, 03:06 PM   PM User | #2
Brandoe85
teh Moderatorinator


 
Join Date: Sep 2004
Location: USA
Posts: 2,472
Thanks: 4
Thanked 40 Times in 40 Posts
Brandoe85 will become famous soon enough
From the sounds of it you'll need to use the where clause:
select * from airport_codes where airport_code = your value

ref:
http://www.databasedev.co.uk/using-where-clause.html

Good luck;
__________________
-Brando
Why using tables for eating is stupid!
Brandoe85 is offline   Reply With Quote
Old 12-13-2006, 03:52 PM   PM User | #3
daraptor
New Coder

 
Join Date: Dec 2006
Posts: 41
Thanks: 6
Thanked 0 Times in 0 Posts
daraptor has a little shameless behaviour in the past
brandoe ....whats the my value....is it the name of the form or what.....plz help me man.....
daraptor is offline   Reply With Quote
Old 12-13-2006, 03:54 PM   PM User | #4
Brandoe85
teh Moderatorinator


 
Join Date: Sep 2004
Location: USA
Posts: 2,472
Thanks: 4
Thanked 40 Times in 40 Posts
Brandoe85 will become famous soon enough
It's the airport_code ( or whatever you type) in your example it would be 'cmh':
select * from airport_codes where airport_code = 'cmh'
__________________
-Brando
Why using tables for eating is stupid!
Brandoe85 is offline   Reply With Quote
Old 12-13-2006, 04:19 PM   PM User | #5
daraptor
New Coder

 
Join Date: Dec 2006
Posts: 41
Thanks: 6
Thanked 0 Times in 0 Posts
daraptor has a little shameless behaviour in the past
hey brandoe thanx man...got it....hey man....one more question....i was able to bring up the airport code which i want..but is there any way i can bring up even if i type in the country.....like
if i type USA..it should bring up all the airport codes in USA.....thanx for the help man...appreciate it.....
daraptor is offline   Reply With Quote
Old 12-13-2006, 04:34 PM   PM User | #6
Brandoe85
teh Moderatorinator


 
Join Date: Sep 2004
Location: USA
Posts: 2,472
Thanks: 4
Thanked 40 Times in 40 Posts
Brandoe85 will become famous soon enough
You're welcome.

Switch the field from airport_code to country:
select * from airport_codes where country = 'USA'
__________________
-Brando
Why using tables for eating is stupid!
Brandoe85 is offline   Reply With Quote
Old 12-13-2006, 06:20 PM   PM User | #7
guelphdad
Super Moderator


 
guelphdad's Avatar
 
Join Date: Mar 2006
Location: St. Catharines, Ontario Canada
Posts: 2,629
Thanks: 4
Thanked 147 Times in 138 Posts
guelphdad will become famous soon enoughguelphdad will become famous soon enough
since you are using ACCESS this does not belong in the MySQL forum, I'll move it into the general database discussion forum.
guelphdad is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:52 AM.


Advertisement
Log in to turn off these ads.