I would like to make a query where I insert a record that is related to 2 more tables.
MaximosyMinimos
INSERT INTO MaximosYMinimos
(ProductoID, SucursalID, Max, Min)
VALUES
((select p.ID from Productos as p where p.ID = 1325 ), (select s.ID from Sucursales as s where s.ID = 1), 0, 0)
but I want to enter all the records of the product table only the ID, of the same for Branches. Taking the N records of the 2 previous tables, and enter them to the table of maximums.
MaximosyMinimos
ID | IProductoID | SucursalID | Max | Min
1 102 20 0 0
2 103 20 0 0
3 105 20 0 0
4 106 20 . .
5 102 21
6 103 21
7 104 21
8 105 21
9 102 22
10 103 22
11 104 22
Where the ID 20 is, for example, branch1 and 21 branch2 and so on. Thanks.