SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: MIN() problem
-
Feb 3, 2006, 12:43 #1
MIN() problem
Code:SELECT f.file, i.last_access, i.id AS pid FROM files f, images i WHERE f.pid = i.id AND f.area = (SELECT MIN(area) FROM files WHERE pid = i.id)
-
Feb 3, 2006, 12:58 #2
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
your query is fine, and requires no GROUP BY
are you sure it isn't a data problem?
do you have a test script of sample rows that illustrate the problem you're seeing?
-
Feb 3, 2006, 13:10 #3
Thank's r937, it was a data problem after all. I was also using varchar to store area values, because of that (I guess), values were compared as strings.
Bookmarks