News:

Wondering if this will always be free?  See why free is better.

Main Menu

SQL Query Question

Started by MisterVertigo, October 22, 2019, 10:29:54 AM

Previous topic - Next topic

MisterVertigo

Hello all! I'm hoping this is the right place for this. If not, please let me know and I can re-post elsewhere.

I'm trying to run a MySQL query against my SMF database to pull some data that I can then open in a spreadsheet. I'm trying to pull user data (name, e-mail, joindate, usergroup, and membergroups).

I've got the query to get the data I need from the users table, and I know how to do a join to get the Primary Membergroup name. However, when it comes to the Additional Membergroups, users can be a member of several and they are stored as id's separated by a comma in the user table. How can I pull the name of each group instead of just the id for this field?

Thank you in advance for your time!

Arantor

You basically can't in raw SQL.
Holder of controversial views, all of which my own.


MisterVertigo

I was kind of afraid of that. If I was going to display on a web page with PHP I know I could do it no problem, but wasn't sure if I could in just SQL. Thank you though!

Advertisement: