Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

How to do order by with out breaking the other columns into multiple sets

$
0
0

Hello There,

Please help mw with this

i have a table with 500k rows, need to split into 3 sets(please assume need to insert 500k into 3 tables, need not to be exact number of rows in each table)


Segment column has 3 values SEG,MOR,CLN
Balance column  has 0 to 100k
dept no column has 300 to 800

each set order by Segment, Balance desc, with out breaking dept no into multiple sets , so one deptno exist only in one set,

also fyi one dept exist in only one segment

Please help me with this

Thanks a ton in advance
Milan



Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>