2
Guys, I have a table and in it a field called cargo
and what value it can repeat, as for example, the teaching position. In my HTML
I’m riding a <select>
When I recover the value of this field, only due to its repeated value it shows several times the word teacher or any other that will be repeated in the table, logical. I wonder if there is some way to "filter" and extract only one value from these repeated?
The solution would be to normalize this table, a table for positions and another for employees, the field
cargo
(description) is not in the employees table, only your id(id_cargo
). PLEASE DON’T USEDISTINCT
.– rray
@rray why can’t I use the DISTINCT?
– Mike
It doesn’t solve the problem, it just masks it. Have you ever wondered what happens when the last intern is promoted or fired? this position will still be available in the combo? Edit the question and put the structure of this table.
– rray
The ideal would be to segment in 2 tables, as rray commented. A table where the position data will be and another one with the employee data, and an employee should contain a position...
– rpereira15