what is primary key in your tables? userid should be your primary key. try to join on that.
and why using as
try after from
select *
from table 1
inner join table 2
on t1.userid=t2.userid
or
this will work i think
select *
from table 1
where userid = (select userid
from table2);
|