I have three tables that I have to take a die in each to make an algorithm in the app, but I would like to know if I have a view that brings me the three data that are in the tables. I would like to know if I have to do this because none of the tables are related, so a JOIN
is not possible.
But if a select does not return anything "0 row (s) affected" it does not bring any of the other tables, could it put a default value? so that the result of the others brings even one of them does not bring any value
The select's to be made are these:
SELECT PrecoBase FROM tbPRECOBASE WHERE Warehouse_Origem = "1" AND Numero_Item = "g";
SELECT * FROM tbPDISC WHERE Division = "BOV" AND Customer = "0" AND Customer_Type = "VD" AND Item_Number = "s" AND date('now') BETWEEN Date_Start AND Date_Finish;
SELECT * FROM tbPDISCQT WHERE tbPDISCQT.Numero_Item = "D53510B" AND 71>=CAST(tbPDISCQT.Quantidade_Inicial AS INTEGER) AND Tipo_Cliente = "JOS" AND DATE('NOW') BETWEEN Data_InicialData_Final;
Note: by the rule always the
tbPRECOBASE
table will bring some result, the others will not always.