I have 2 tables.
table2 structure:
name
os
count
table1 structure:
name
Examples of table2: Fred Android 50 Tom iOS 3 Tom iOS 3 Fred Android 1 Fred Android 1 James iOS 20
Table1 has a list of names (unique).
My current query (stored in PHP variable $sqlx) is
$sqlx = "SELECT COUNT(*) AS numberOfRows FROM table2 where name = 'Fred' AND count < '6' AND os = 'iOS' GROUP BY name";
How do I make a subquery so that I don't have to enter 'Fred' so that the name is selected from table1?