Hi, suppose I have two tables
table User
{
id integer,
name text,
address text
}
Table UserWork
{
userid integer references User(id),
work text
}
Suppose I have three users
id name address
1 Tony main street
2 Peter Big ave
3 Richard Loop Blvd
And two of them work
UserWork
userid work
1 programming
3 studying
I would like to join table user and userwork, where if a user has a
work, I list it. If he does not, I give it some default value "no work"
Join User and UserWork
id name address work
1 Tony main street programming
2 Peter Big ave no work
3 Richard Loop Blvd studying
How can I write the sql?
Thanks,
qq