Hi @Vineet S
how to add partition by in below table where there is no date key or duration..please give example
If you mean using PARTITION BY
in Windows Functions, then the key is to choose a column (or columns group) that makes sense for dividing your data into groups. You don’t need a date or duration column to partition the data. For example, you can partition by product
or productcategory
.
If you mean creating partitioned table where there is no date key or duration, you can still partition by other columns that makes sense for your data.
For example, you could partition by different product types, like foods, clothes, appliances...
Or partition by the range of sales, like 0~500 belongs to partition1, 501~1000 belongs to partition2...
For more details, review this doc: Create partitioned tables and indexes.
Also, see these two articles for more examples: Database table partitioning in SQL Server; SQL Server Table Partitioning.
Best regards,
Cosmog
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".