LPS-48165 Make sure that inner query doesn't return multiple lines