I have a database Faculty_Artwork with the fields ID, Artwork, Faculty_ID, ArtTitle, ArtMedium, ArtSize, ArtYear, and ImageNo. It's set up so I can search according to Faculty_ID and I'm supposed to get nothing when there are no rows with that specific number in Faculty_ID. But when I run a query of a Faculty_ID that isn't in there, for example: SELECT max(ImageNo) FROM Faculty_Artwork WHERE Faculty_ID = 316 I get a returned row with 316 assigned to ID and that's all that's in the query. Anyone know why I'm getting records at all?
I did a similar test with a database, and what I got is just null in the max(xxx) field. So, if in theory it works for you, it should just return null.
You can't get a value assigned to ID, since you aren't selecting the ID field. And if there's no Faculty_ID 316 in your table, then the value returned by the query should be NULL, just like briteguy1227 says. If you get a different result, it means the query you're testing isn't the one you posted here, or there's data in your database that meets the requirements of your WHERE statement.