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

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

java - Could not locate OpenAL library -

Non Unique Username with ASP.Net Identity 2.0 -