MySQL Forums
Forum List  »  Newbie

Data from 2 tables
Posted by: Jack Tullous
Date: November 26, 2019 12:09PM

Afternoon all,

I am in the process of trying to understand mysql queries and have a question.

I have 2 tables as below

table 1 name

idname,name, last
1 , joe , smith
2 , jane , smith
3 , john , Thomas

table 2 sex

idsex,idname,sex

1, 1 , male
2, 2 , female
3 , 3 , male

Sorry for the crude drawing :)

But I was trying to make a query to filter to show name and sex by males.

Select name from name where last = 'smith' <--- from here im lost and cant figured out how to query out the sex

so I want to show

name, last, sex from the 2 different tables.

Anyone care to help?

Options: ReplyQuote


Subject
Written By
Posted
Data from 2 tables
November 26, 2019 12:09PM
November 26, 2019 02:18PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.