mysql db table query -


i have 2 tables:

users{user_id, username, picture} likes{id, user_id, image_id} 

the query im trying is:

select username, picture user , likes user_id=user_id , image_id=4 

but dnt know how connect them, thanks

the key use inner join between 2 tables.

select u.username, u.picture     user u         inner join likes l             on u.user_id = l.user_id     l.image_id = 4 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -