jeudi 28 avril 2016

SQL select statement calculating area from width and height

I need to select data from a table of images. Each image has the width and height stored, but I want to calculate the area in order to select larger or smaller images, regardless of aspect ratio.

Currently I have SELECT * FROM image WHERE width >= 640 AND height >= 480, but obviously this doesn't work if the image is very wide but not very high.

Is there a way to make a query more along the lines of SELECT * FROM image WHERE [area calculated from image] >= [area calculated from query width and height]?

Thank you.

Aucun commentaire:

Enregistrer un commentaire