I have two tables
- tbltask
- tbluser
In tbluser I have two columns, userid and username
Sample data:
1 ibrahim
2 nizam
3 shahrukh
4 saddam
and in my second table, I have multiple tasks
taskid userid assignby assignto
-------------------------------------
1 4 4 2
Here saddam assigned a task to nizam
2 3 3 1
Here shahrukh assigned a task to ibrahim
I have a select command like
select userid, assignby, assignto from tbltask where taskid='1'
and i am getting this
3 3 1
now i want to join the table, because instead of i, i want username to be displayed
so answer which i want to display will be
shahrukh shahrukh ibrahim
how i can join the table?
joinworks, you may want to study sql a bit more before asking such elementary questions.