Page is a not externally linkable
- Code, Content, and Presentation
-- Databases
---- how to select state name from states within nested select


sukebe - 4:46 pm on Aug 9, 2010 (gmt 0)


I tried your query but it returned a zero result. I then modified it so that the select had states.short_name instead of users.state, but that didn't help. Also there is a parens after 'users.state'. I wasn't sure, so I tried it without and with an open parens at states.stid =.

basically, within the users table, the users.state is a number that corresponds with states.stid. so SELECT short_name FROM states WHERE stid = '5' will result in 'CA'. I'm trying to get that 'CA' in the query I'm trying, instead of the '5'.

Thanks!


Thread source:: http://www.webmasterworld.com/databases_sql_mysql/4182647.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com