0

On table A I got these two fields:

user_level, username

On table B I got these two fields:

username, notes

I would like to use a mysql query to fetch the notes from all usernames where the level_id = 4.
How would the database connection look like to achieve this?

Thanks in advance

1
  • Nothing about connection here. You need sql query. Commented Apr 26, 2011 at 7:49

3 Answers 3

1
SELECT * FROM `A` JOIN `B` USING(`username`) WHERE `user_level` = 4;
Sign up to request clarification or add additional context in comments.

Comments

1

SELECT notes FROM B b INNER JOIN A a ON (b.username = a.username) WHERE a. user_level = 4

Comments

0

Select username, notes from B inner join A on a.username=b.username where user_level=4

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.