Just to mention it: very good way to put the question!
If everybody would do it like this, providing answers would be a whole lot easier.
In case you want to improve this even further, please provide a working example next time.
Something like this:
create column table customers (id integer, name varchar(30))
insert into customers values (1, 'BLA');
insert into customers values (2, NULL);
insert into customers values (3, 'BLUPP');
insert into customers values (4, NULL);
insert into customers values (5, 'BLIP');
insert into customers values (6, 'BLOP');
select c1.id, c1.name as c1name, c2.name as c2name, coalesce (c1.name, c2.name)
from
customers c1 inner join customers c2
on c1.id = c2.id+1
order by c1.id
is already sufficient to work with your issue.
- Lars