sql - Can I create a MYSQL select statement with a column which consists on another select statement? -
i'm trying export data old drupal site. hoping mysql query this:
select users.uid, name, pass, mail, created, (select rid users_roles users_roles.uid = users.uid) all_rids users
so row of output might like:
"1000", "frank smith", "123456", "frank@example.com", "12/15/2012", "3,7,12"
the point last column array consisting of values select statement
...sorry, forget proper terminology type of query, pretty sure possible in sql server.
is possible in mysql? if so, syntax?
there may multiple matches. think want use group_concat()
in subquery:
select users.uid, name, pass, mail, created, (select group_concat(rid) users_roles users_roles.uid = users.uid ) all_rids users;
Comments
Post a Comment