1
I have three tables that I have to take a dice in each to make an algorithm in the app, only I would like to know if there is a view that brings me this three data that are in the different tables. I’d like to know if there’s any way I can do this because none of the tables are related, so with 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, it would be possible to put a value default? so that the result of the others brings even if one of them brings no value
The select’s to be made are those:
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 table
tbPRECOBASE
will bring some result, the others not always.
Put the layout of the tables !!! I believe help answer your question, better, edit your question by placing the table layout and right after which fields you want to bring !!!
– user6026
I will put here the selects, so that by the rule always the table tbPRECOBASE will bring a response the others will bring and sometimes will not bring SELECT Precobase FROM tbPRECOBASE WHERE Warehouse_origin = "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.Quantitystarting AS INTEGER) AND Tipo_client = "JOS" AND DATE('NOW') BETWEEN Data_initial_ata_final;
– user7791