1
I have a specific table with the data that I do the search (sales_flat_order
) where column status
has among other values
('entregue'
, 'entregue_pd'
, 'entregue_pd_pago'
, 'avaliacao_solicitado'
, 'avaliado_negativamente'
, 'avaliado_positivamente'
), but when I use the between
does not bring the correct information since when being consulted separately I have return of all this is the script
(
SELECT entity_id, status FROM sales_flat_order where
(status between 'entregue_pd_pago'
and 'entregue'
and 'entregue_pd_pago'
and 'avaliacao_solicitado'
and 'avaliado_negativamente'
and 'avaliado_positivamente'
);
)
I am using Mysql Workbench.
BETWEEN is for checking if a value is in a range. For example,
year BETWEEN 2015 AND 2019
. It didn’t make any sense in what you tried to do, let alone make it clear what your intention was. You want to return the record if thestatus
be one of those listed?– Woss
You’re making the wrong use of
between
you’re trying to make aIN (value1,value2,value3,value4)
– Erlon Charles
would like to return the id s that were with those status but as you yourself mentioned the in must resolve. Anderson Carlos Woss
– Claudio Fernandes