I have the following database table:
*Table structure for table 'resultados' */
DROP TABLE IF EXISTS 'resultados';
CREATE TABLE 'resultados' (
'cpf' varchar(14) NOT NULL,
'nome' varchar(255) DEFAULT NULL,
'codcurso' int(5) DEFAULT NULL,
'nota' float DEFAULT NULL,
PRIMARY KEY ('cpf')
);
/*Data for the table 'resultados' */
insert into 'resultados'('cpf','nome','codcurso','nota') values
('123.456.789-01','Alexandre Mie Lopes Mesa',78,4.21),
('123.876.332-72','Maria Ximenes Rosa',1,9.16),
('222.333.444-55','Livia Fernandes Linderberg',43,9.87),
('232.234.789-77','Karol Linderberg',43,8.92),
('289-890-912-76','Pedro Solano Susp',16,4.21),
('345.678.900-37','Amilton Pedro da Silva',78,9.98),
('432.654.987-21','Julio Martinez Silva',21,7.34),
('454.098.123-45','Luiz Henrique de Souza',1,7.35),
('765.123.098-22','Juliana Lopes Alves',22,5.67),
('903.201.871-23','Luiz Peres Lopes',16,8.77),
('987.654.321-10','Ana Alves de Souza',78,9.12);
And I want to select the minimum value when I use only:
SELECT min(nota) AS menor FROM resultados
I get the result (4.21), but if I want to create a table, with the students with the lowest grade I can not get such table
SELECT * FROM resultados WHERE nota = 4.21
I also tried to save this value as float and pass as var but it was not possible, I just could do with the following code:
SELECT * FROM resultados WHERE nota like '" + menorR + "'"
where smallerR = 4.21
I want to understand why note = (float number) did not work