Using MySQL Join -


i'm trying join 2 mysql tables staffid 1 , username tied staffid in table have username displayed

select ost_ticket.staff_id, count(*) numbers  ost_ticket join ost_staff re on re.username = us.userid group ost_ticket.staff_id; 

from i've been reading joins should work?

edit: i've ran , unknown column 'ost_ticket.staff_id' in field list

select us.staff_id, re.username, count(*) numbers  ost_ticket join ost_staff re on re.userid= us.staff_id group us.staff_id; 

Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -