Good evening, gentlemen, how are you? I'm facing a problem and I'm not able to resolve it.
Below is an example of the structure of my database:
IneedtomakeascriptinMYSQLthatselectspeoplewhomeetthefollowingconditions:
1-PESSOA_ENDERECO.UF="MS"
2 - PERSONAL_PRESENTATION_DATA_TERMINO > NOW ()
3 - PRESS_EMPRESTIMO.TIPO_EMPRESTIMO = 'CARTAO'
4 - PESSOA_EMPRESTIMO.CODIGO_BANCO = '0001'
(this is the part I'm not getting) 5 - THAT THEY HAVE A MARGIN AVAILABLE ABOVE A SPECIFIC PERCENTAGE;
The available margin is calculated as follows:
35% of the value that is in PERSON_BENEFICIO.VALOR less the sum of all the VALUE_PARCELA of the benefit in question.
that is: if the person receives 1300 of benefit, the margin of it is 455; the available margin would be 455 less the sum of all the portions of the loans she has.