I have a list of guild but I don’t want to call that sql for each guild. (check previous post for the structure)
This one is a little easier, you just have to use the IN (PARAMETER, OPERAND, KEYWORD) instead of equal (=) and you give your list of guild you want in it.
select * where
from USER_TABLE u inner join JOB_ASSIGN assign on u.USER_ID = assign.USER_ID, GUILD_TABLE guild where assign.guildId = guild.id AND assign.guildid = ?
If you want to hand pick the number of guild you can use the KEYWORD IN:
select * where
from USER_TABLE u inner join JOB_ASSIGN assign on u.USER_ID = assign.USER_ID, GUILD_TABLE guild where assign.guildId = guild.id AND assign.guildid IN (12,13,14)
Related : What to do if I want give a list of value in my where clause parameters?
Recent Comments