SQL OPTION IN LOOKUP
Posted: 2019-03-20 19:45
I have a lookup field in a table,
this lookup is connected 3 tables
what I want to do is reduce the list if one of these tables already selected a value from the list
I added a field in the lookup table called decrizione_inv and in my idea this field is empty or null if noone of these 3 tables have selected the value from the list
before show the list I think I need to filter using sql, I think is the advanced option in appgini where you can write sql
so I tryed it, but I get a empty list becase I think sql request is not precise
TEST:
SELECT `dt_inventario`.`id_inventario`, `dt_inventario`.`num_inventario`,
`dt_inventario`.`descrizione_inv` FROM `dt_inventario` LEFT JOIN `dt_tip_inventario` as dt_tip_inventario1 ON `dt_tip_inventario1`.`id_tip_inventario`=`dt_inventario`.`categoria_inv` WHERE `dt_inventario`.`num_inventario` IS NULL OR `dt_inventario`.`num_inventario` = '' ORDER BY 2
this lookup is connected 3 tables
what I want to do is reduce the list if one of these tables already selected a value from the list
I added a field in the lookup table called decrizione_inv and in my idea this field is empty or null if noone of these 3 tables have selected the value from the list
before show the list I think I need to filter using sql, I think is the advanced option in appgini where you can write sql
so I tryed it, but I get a empty list becase I think sql request is not precise
TEST:
SELECT `dt_inventario`.`id_inventario`, `dt_inventario`.`num_inventario`,
`dt_inventario`.`descrizione_inv` FROM `dt_inventario` LEFT JOIN `dt_tip_inventario` as dt_tip_inventario1 ON `dt_tip_inventario1`.`id_tip_inventario`=`dt_inventario`.`categoria_inv` WHERE `dt_inventario`.`num_inventario` IS NULL OR `dt_inventario`.`num_inventario` = '' ORDER BY 2