DB query test. Query output rewrited