Tablo_a sütunu product_id, store_id, x ile var.Postgres sıralama bileşik anahtar
store_id | product_id | sequence_number
1 | 1 | 1
1 | 1 | 2
1 | 1 | 3
1 | 2 | 1
1 | 2 | 2
2 | 1 | 1
2 | 1 | 2
o sql sorgusu ile bunu yapmak mümkün mü:
Ben
create table_b as
select store_id, product_id, sequence_number
from table_a
sequence_number otomatik şuna benzer gerekiyordu numarasını oluşturulur istiyor?
Sen ') (ROW_NUMBER' arıyoruz: http://www.postgresql.org/docs/current/static/tutorial-window.html –