私はそのようなSQL文を持っています
select users.id, users.username, count(orders.number) as units from users inner join orders on orders.user_id = users.id where users.id = 1;
これは、ユーザーIDが作成した数または単位になります。
すべてのユーザーと、ユーザーが購入した数またはユニットを取得するにはどうすればよいですか? where キーワードには値と特定の値が必要ですが、どうすればすべてのユーザーと言えますか。
これを読んでくれてありがとう:)