我有两张桌子
桌子login
account_id | name
========================
12345 | thuong1
12346 | thuong2
12347 | thuong3
桌子char
account_id | char
========================
12345 | name1
12345 | name2
12345 | name3
12345 | name4
我要选择...
SQL 1
SELECT account_id FORM char WHERE char='name1'
我会有结果
12345
SQL 2
SELECT login.account_id, login.name, char.char WHERE login.account_id=char .account_id GROUP BY login.account_id , login.name, char.account_id, char.char HAVING login.account_id = 12345
结果
account_id | name | char
12345 | thuong1 | name1
12345 | thuong1 | name2
12345 | thuong1 | name3
我如何用 1 个 sql 查询选择它?