Pelles C forum

C language => Beginner questions => Topic started by: Grincheux on October 24, 2020, 01:33:52 PM

Title: sqlite max AND min
Post by: Grincheux on October 24, 2020, 01:33:52 PM
Usually MAX and MIN are used like this SELECT MIN([C1]) AS Mini,MAX([C2)) AS Maxi FROM [MyTable];

There is an other way to use them

SELECT MAX([C1],[C2],][C3]) AS MAX_C1_C2_C3, MIN([C1],[C2],[C3]) AS MIN_C1_C2_C3 FROM [MyTable];

Becareful, I have used it on a table with one record, if there are many hundreds of records you have to drink a lot of coffee before getting the result. ;D ;D ;D