[eluser]Sceneshift[/eluser]
Hi guys,
I'm trying to join on a table twice, the same field each time.
Code:
$this->db->select('user_users.username as author, user_users.username as last_msg_by')
->join('user_users', 'user_users.id = forums_threads.ID_MEMBER_STARTED', "left")
->join('user_users', 'user_users.id = forums_threads.ID_MEMBER_UPDATED', "left")
//->join('forums_posts', 'forums_posts.topic_id = forums_threads.ID_FIRST_MSG', "left")
//->where('forums_threads.board', $forum_id)
//->orderby('forums_threads.id', 'desc');
Apparently this query won't work, because the user_users table is not unique, or something. Is it possible to join on the same field twice in one query>