3
I have the following scenario and need to add the result of a Select in another column of the same table, for example, a column with the numbers and another to check how often these numbers appear:
números|frequência
1 | 2
2 | 1 E assim por diante.
I was able to make a select that selects and shows the frequency, as below, but I do not know how to add the result that is the frequency in another column, because I need to use the results of these columns in HTML.
Select to check the frequency:
select distinct id, CONCAT(numeros, "frequencia",count(id)) as Numeros from tb_numeros group by numeros;
The result is coming out so far:
[{"id":1,"Numeros":"1 - frequencia - 3"},{"id":2,"Numeros":"2 - frequencia - 1"}]
Thank you very much for your attention!
Guys, I reported that it was from the same column, but I need it to be in another table. Thank you guys.
– Luann Rodrigo