Join two tables in MySQL, selecting random rows from the first one
I have two tables, table 1 has one row per variable, while table 2 has many rows per variable. I want to randomly select 1000 rows from table 1 (1000 variables) and then join those to table 2. Final table will have many rows per variable. I’m also adding conditions for the selection from both tables. This is my code but it’s not picking 1000 variables from table 1: