question

MOHDSHAHBANIMOHDZAHIR-1015 avatar image
0 Votes"
MOHDSHAHBANIMOHDZAHIR-1015 asked MOHDSHAHBANIMOHDZAHIR-1015 commented

Autogenerate insert value like excel

115642-image.png


Hi,

I have 8 group name to insert to 1000 row repeatably. How to do it in Data Services to generate automatically the 5 username insert to 1000 row ?

thanks.

sql-server-general
image.png (26.1 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ErlandSommarskog avatar image
0 Votes"
ErlandSommarskog answered MOHDSHAHBANIMOHDZAHIR-1015 commented

Not sure what you mean with Data Services, but there are so many products in the Data Platform sphere, I can't keep track of them all.

In plain SQL query you can do:

SELECT BIL, POSKOD, STATUS, KETERANGAN, LOKASI, 
        row_number() OVER(ORDER BY BIL) / % 8 + 1
FROM  tbl

The row_number function numbers the rows ordered by what you specify in the ORDER BY clause. % is the modulus operator.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks. It works perfectly.

0 Votes 0 ·