这个职位表中检索来自多个表中的数据 <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCommentsTable extends Migration
{
/**
* Run the migrations.
表1 Customer id city
John 1 LA
Nancy 2 NULL
表2 Customer $ in the pocket
John 20
Nancy 30
我学习的关系代数。 我在想如果Table 1自然加入与Table 2会发生什么?我的猜测是,结果将是4个属性,John和Nancy都会出现。 但是,我的朋友告诉我,只有约翰会出现,南希不会因为有一个n
我想了解SELECT IN更好。这是否是一个有效的查询? SELECT name
FROM products
WHERE product_id IN
(SELECT product_id, SUM(unit_price)
FROM sales
GROUP BY product_id
HAVING (SUM(unit_price) > 200));