skip to Main Content

I have one table for users (userid is the pk) and a second table for items (itemid is the pk)
I need to have those two tables into one table, how could I do that in phpmyadmin?

enter image description here

2

Answers


  1. you cna use left join lateral :

    SELECT 
    * 
    FROM USERS
    LEFT JOIN LATERAL 
      ( select * from  ITEMS) ITEMS
    ON 1 = 1
    WHERE userid = 1
    
    Login or Signup to reply.
  2. You seem to want a cross join:

    select u.*, i.*
    from users u cross join
         items i
    where u.userid = 1;
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search