Hi everyone,
I am trying to find out how to make a query within an array.
i make a query where i get from a table named 'other_info', an array with all the user id's resulting from a subquery.
what i want is to get the all the user_names and ages from the users living particular state.
where the tables are designed this way:
table: users
table other_info
what is the right syntax for this query?
if you have any suggestion, please let me know
thank you very much
bilibytes
I am trying to find out how to make a query within an array.
i make a query where i get from a table named 'other_info', an array with all the user id's resulting from a subquery.
Code:
SELECT user_name
FROM users
WHERE users.user_id IN
(
SELECT other_info.user_id, other_info.age
FROM other_info
WHERE other_info.state = $state
)
where the tables are designed this way:
table: users
Code:
user_id | user_name
Code:
user_id | age | state
if you have any suggestion, please let me know
thank you very much
bilibytes
Comment