Adam Dziendziel <[EMAIL PROTECTED]> writes: > SELECT COUNT(*) FROM drzewo_towar WHERE lft > 13 AND rgt < 14 GROUP BY towar > ... > the engine doesn't return the value (the above query should return 0).
COUNT(*) returns NULL if there are no records selected. Change the query like this to accomplish what you're looking for: SELECT COALESCE(COUNT(*), 0) FROM drzewo_towar WHERE lft > 13 AND rgt < 14 GROUP BY towar; Derrell