MYSQL where clause join a string search -
very hard me describe this, i'll show want trying to
albums_lookup has structure
lookup | id
where lookup in format uid/title
my query
select `id` `albums_lookup` `lookup` = (select `id` `users` `username` = 'someusername') + '/sometitle'
as can tell, have username, need first id of user, append text '/sometitle' in clause
you should use concat
, join
:
select id albums_lookup al inner join users u on concat(al.lookup, '/sometitle') = u.id u.username = 'someusername';
Comments
Post a Comment