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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -