2
I own a table of produtos where there is the primary column id, wish to select products with the probable name of "%TV%" however i want it to be ordered so DESC normally, however I want some IDS come before others, the IDS that are in the promotion, for example 5, 4 respectively.
In this example the result order (by ID) should be: 5, 4, e depois os outros, como 1, 2, 3, 6...
id | name |
---------------
1 | tv |
2 | core |
3 | tv other |
4 | tv board |
5 | apple TV |
6 | core |
And how do you know which ones
IDSproducts on sale? There is another table related?– Marcelo de Andrade
@Marcelodeandrade not, those
IDSwould be directly inserted in the same query..– Elaine
No no, but just by this table with only these two fields has no way of knowing which
IDSare on sale. How do you define this?– Marcelo de Andrade
@Marcelodeandrade they are defined manually, why they are fixed, it is as if I reserved 5 promotions, in case 5 IDS (1-5) and I put that product with one of these IDS.
– Elaine
But there’s some kind of column
flagtrue/false that indicates that that product is on sale? If not, you need to review how is the relational structure of that.– Marcelo de Andrade
@Marcelodeandrade was thinking of making two
ORDER? I thought of something related but unfortunately the structure does not allow. There is no indicator other than theIDSspecial.– Elaine
Is there a way to add at least one column to indicate that the product is on sale? Special IDS are fixed?
– Marcelo de Andrade
@Marcelodeandrade yes, they are fixed (I mean fixed but are changed in a long term). Unfortunately no, this indicator that is on sale or is not just the IDS that I receive.
– Elaine