Sql |
SELECT distinct a.style_id,
case a.style_id
when 197889 then 1
when 110158 then 2
when 228607 then 3
when 242383 then 4
when 247575 then 5
when 287570 then 6
when 120379 then 7
when 208966 then 8
when 133828 then 9
when 221027 then 10
when 267856 then 11
when 279955 then 12
when 287580 then 13
when 279956 then 14
when 225296 then 15
when 208960 then 16
when 225274 then 17
when 111344 then 18
when 115867 then 19
when 279938 then 20
when 278428 then 21
when 279973 then 22
when 278396 then 23
when 289754 then 24
when 278355 then 25
when 280197 then 26
when 268320 then 27
when 221016 then 28
when 281189 then 29
when 267874 then 30
when 278402 then 31
when 305601 then 32
when 280021 then 33
when 280022 then 34
when 280191 then 35
when 280192 then 36
when 316702 then 37
when 247804 then 38
when 268269 then 39
when 268338 then 40
when 278353 then 41
when 281398 then 42
when 247750 then 43
when 247805 then 44
when 267815 then 45
when 268306 then 46
when 268313 then 47
when 278404 then 48
when 278394 then 49
when 281228 then 50
when 285841 then 51
when 221025 then 52
when 280014 then 53
when 279987 then 54
when 225343 then 55
when 247785 then 56
when 247811 then 57
when 285440 then 58
when 268285 then 59
when 282177 then 60
when 286228 then 61
when 247781 then 62
when 267847 then 63
when 267851 then 64
when 267868 then 65
when 267880 then 66
when 267840 then 67
when 267842 then 68
when 267865 then 69
when 268316 then 70
when 268304 then 71
when 277914 then 72
when 278419 then 73
when 278391 then 74
when 279959 then 75
when 281185 then 76
when 280163 then 77
when 247829 then 78
when 247769 then 79
when 286222 then 80
when 279960 then 81
when 242411 then 82
when 247761 then 83
when 144019 then 84
when 267861 then 85
when 268259 then 86
when 268286 then 87
when 279965 then 88
when 279972 then 89
when 279958 then 90
when 247748 then 91
when 285519 then 92
when 290504 then 93
when 215419 then 94
when 298051 then 95
when 285810 then 96
when 267870 then 97
when 267877 then 98
when 267809 then 99
when 267812 then 100
when 267834 then 101
when 268332 then 102
when 268463 then 103
when 268351 then 104
when 268343 then 105
when 267866 then 106
when 277902 then 107
when 278385 then 108
when 278424 then 109
when 278377 then 110
when 278372 then 111
when 280013 then 112
when 280156 then 113
when 280154 then 114
when 280864 then 115
when 281227 then 116
when 281740 then 117
when 281413 then 118
when 282153 then 119
when 280198 then 120
when 283350 then 121
when 283354 then 122
when 283348 then 123
when 279998 then 124
when 247746 then 125
when 247581 then 126
when 289758 then 127
when 286210 then 128
when 225271 then 129
when 267888 then 130
when 267871 then 131
when 267872 then 132
when 267855 then 133
when 268301 then 134
when 268275 then 135
when 268282 then 136
when 268260 then 137
when 278361 then 138
when 278356 then 139
when 279993 then 140
when 279957 then 141
when 281263 then 142
when 281744 then 143
when 285872 then 144
when 285874 then 145
when 287920 then 146
when 225319 then 147
when 247796 then 148
when 247795 then 149
when 247799 then 150
when 247784 then 151
when 247776 then 152
when 285157 then 153
when 285204 then 154
when 286225 then 155
when 285802 then 156
when 290522 then 157
when 278368 then 158
when 267806 then 159
when 267813 then 160
when 267808 then 161
when 268318 then 162
when 268280 then 163
when 268326 then 164
when 268310 then 165
when 279940 then 166
when 281255 then 167
when 285854 then 168
when 282143 then 169
when 289013 then 170
when 291923 then 171
when 242378 then 172
when 242387 then 173
when 247735 then 174
when 247806 then 175
when 247775 then 176
when 285439 then 177
when 286183 then 178
when 286192 then 179
when 287913 then 180
when 289735 then 181
when 290680 then 182
when 290683 then 183
when 290795 then 184
when 291060 then 185
when 290527 then 186
when 291044 then 187
when 267879 then 188
when 268274 then 189
when 268261 then 190
when 268309 then 191
when 268298 then 192
when 278359 then 193
when 279980 then 194
when 279942 then 195
when 280196 then 196
when 280155 then 197
when 280195 then 198
when 281229 then 199
when 285856 then 200
when 286229 then 201
when 309635 then 202
when 268314 then 203
when 268307 then 204
when 277892 then 205
when 277887 then 206
when 280164 then 207
when 281207 then 208
when 281426 then 209
when 282148 then 210
when 279941 then 211
when 283365 then 212
when 228609 then 213
when 242390 then 214
when 247663 then 215
when 247744 then 216
when 247733 then 217
when 247740 then 218
when 247803 then 219
when 247585 then 220
when 285192 then 221
when 285377 then 222
when 285384 then 223
when 286224 then 224
when 286194 then 225
when 287917 then 226
when 289727 then 227
when 289767 then 228
when 290731 then 229
when 290688 then 230
when 291111 then 231
when 291067 then 232
when 290531 then 233
when 290510 then 234
when 290488 then 235
when 267822 then 236
when 267881 then 237
when 267876 then 238
when 268311 then 239
when 268272 then 240
when 282169 then 241
when 283352 then 242
when 283367 then 243
when 116994 then 244
when 242417 then 245
when 247771 then 246
when 285406 then 247
when 285170 then 248
when 285171 then 249
when 285174 then 250
when 285373 then 251
when 285343 then 252
when 287586 then 253
when 289765 then 254
when 289769 then 255
when 107981 then 256
when 277915 then 257
when 279961 then 258
when 298730 then 259
when 298749 then 260
when 299059 then 261
when 247754 then 262
when 247774 then 263
when 247780 then 264
when 247583 then 265
when 285198 then 266
when 285199 then 267
when 285345 then 268
when 285502 then 269
when 287921 then 270
when 290520 then 271
when 290515 then 272
when 290803 then 273
when 291082 then 274
when 291041 then 275
when 291874 then 276
when 292976 then 277
when 280836 then 278
when 247731 then 279
when 247550 then 280
when 247654 then 281
when 285176 then 282
when 285517 then 283
when 287565 then 284
when 289759 then 285
when 290518 then 286
when 290720 then 287
when 291079 then 288
when 291091 then 289
when 279991 then 290
when 280158 then 291
when 298702 then 292
when 225317 then 293
when 225365 then 294
when 328610 then 295
when 228585 then 296
when 285357 then 297
when 285154 then 298
when 286223 then 299
when 290817 then 300
when 290820 then 301
when 290586 then 302
when 291878 then 303
when 247797 then 304
when 287927 then 305
when 287585 then 306
when 290722 then 307
when 290793 then 308
when 281418 then 309
when 298688 then 310
when 207519 then 311
when 109162 then 312
when 268303 then 313
when 298721 then 314
when 285184 then 315
when 289016 then 316
when 289006 then 317
when 307898 then 318
when 285823 then 319
when 287566 then 320
when 207525 then 321
when 207522 then 322
when 277888 then 323
when 280023 then 324
when 298743 then 325
when 286230 then 326
when 247549 then 327
when 288126 then 328
when 309609 then 329
when 305084 then 330
when 289003 then 331
when 289009 then 332
when 289332 then 333
when 291889 then 334
when 297406 then 335
when 298071 then 336
when 290674 then 337
when 197639 then 338
when 309305 then 339
when 330984 then 340
when 331043 then 341
when 331037 then 342
when 228587 then 343
when 288144 then 344
when 289374 then 345
when 290596 then 346
when 290475 then 347
when 291875 then 348
when 294943 then 349
when 298072 then 350
when 300614 then 351
when 301152 then 352
when 307727 then 353
when 307787 then 354
when 307790 then 355
when 247813 then 356
when 329952 then 357
when 225303 then 358
when 285959 then 359
when 288169 then 360
when 289757 then 361
when 291723 then 362
when 296466 then 363
when 298060 then 364
when 298988 then 365
when 307700 then 366
when 307862 then 367
when 288076 then 368
when 288147 then 369
when 288887 then 370
when 288117 then 371
when 291900 then 372
when 294957 then 373
when 310323 then 374
when 316696 then 375
when 330985 then 376
when 277580 then 377
when 291744 then 378
when 291913 then 379
when 296553 then 380
when 297380 then 381
when 307879 then 382
when 247779 then 383
when 305045 then 384
when 307755 then 385
when 331041 then 386
when 331038 then 387
when 138332 then 388
when 290481 then 389
when 291743 then 390
when 291915 then 391
when 300613 then 392
when 305041 then 393
when 309322 then 394
when 316664 then 395
when 211441 then 396
when 285922 then 397
when 288044 then 398
when 288133 then 399
when 289346 then 400
when 290653 then 401
when 294956 then 402
when 296464 then 403
when 297363 then 404
when 299031 then 405
when 300617 then 406
when 108023 then 407
when 310314 then 408
when 322496 then 409
when 298741 then 410
when 288055 then 411
when 290588 then 412
when 290706 then 413
when 291745 then 414
when 294964 then 415
when 296455 then 416
when 296616 then 417
when 298053 then 418
when 299067 then 419
when 225293 then 420
when 305109 then 421
when 305073 then 422
when 319839 then 423
when 322625 then 424
when 225307 then 425
when 311646 then 426
when 211437 then 427
when 285924 then 428
when 288066 then 429
when 291747 then 430
when 291746 then 431
when 296615 then 432
when 211438 then 433
when 221023 then 434
when 220950 then 435
when 225352 then 436
when 252017 then 437
when 305002 then 438
when 305078 then 439
when 309313 then 440
when 310317 then 441
when 322588 then 442
when 325331 then 443
when 325329 then 444
when 298740 then 445
when 164783 then 446
when 288080 then 447
when 291742 then 448
when 292039 then 449
when 292038 then 450
when 296458 then 451
when 322572 then 452
when 325358 then 453
when 325321 then 454
when 225331 then 455
when 305104 then 456
when 322586 then 457
when 330986 then 458
when 211442 then 459
when 297892 then 460
when 211434 then 461
when 310285 then 462
when 193570 then 463
when 222565 then 464
when 225308 then 465
when 305082 then 466
when 309318 then 467
when 309317 then 468
when 305052 then 469
when 114695 then 470
when 123645 then 471
when 222584 then 472
when 211439 then 473
when 123628 then 474
when 225353 then 475
when 191514 then 476
when 325233 then 477
when 172841 then 478
when 288170 then 479
when 325292 then 480
when 319929 then 481
when 118213 then 482
when 221032 then 483
when 221029 then 484
when 122332 then 485
when 149682 then 486
when 123646 then 487
when 292981 then 488
when 289418 then 489
when 206749 then 490
when 221037 then 491
when 135306 then 492
when 222573 then 493
when 297390 then 494
when 117142 then 495
when 220924 then 496
when 179760 then 497
when 170534 then 498
when 200030 then 499
when 225314 then 500
when 293063 then 501
when 215192 then 502
when 173177 then 503
when 133629 then 504
when 193444 then 505
when 293106 then 506
when 293099 then 507
when 225305 then 508
when 288073 then 509
when 292041 then 510
when 325208 then 511
when 166566 then 512
when 184037 then 513
when 133164 then 514
when 131095 then 515
when 116993 then 516
when 292987 then 517
when 235830 then 518
when 211440 then 519
when 297412 then 520
when 325298 then 521
when 110026 then 522
when 293071 then 523
when 293069 then 524
when 293070 then 525
when 211891 then 526
when 136716 then 527
when 179239 then 528
when 129957 then 529
when 296569 then 530
when 329580 then 531
when 194353 then 532
when 220982 then 533
when 246974 then 534
when 192759 then 535
when 220932 then 536
when 225327 then 537
when 309606 then 538
when 148510 then 539
when 164665 then 540
when 122439 then 541
when 167704 then 542
when 163144 then 543
when 110017 then 544
when 133830 then 545
when 114911 then 546
when 134157 then 547
when 158524 then 548
when 101976 then 549
when 164978 then 550
when 164711 then 551
when 327075 then 552
when 164979 then 553
when 163268 then 554
when 121358 then 555
when 144858 then 556
when 143881 then 557
when 152316 then 558
when 164336 then 559
when 316708 then 560
when 133411 then 561
when 138209 then 562
when 164015 then 563
when 164667 then 564
when 164929 then 565
when 164666 then 566
when 136701 then 567
when 167701 then 568
when 168148 then 569
when 168100 then 570
when 329516 then 571
when 133921 then 572
when 134432 then 573
when 115743 then 574
when 144859 then 575
when 136638 then 576
when 134542 then 577
when 158514 then 578
when 193195 then 579
when 327066 then 580
when 327067 then 581
when 137242 then 582
when 133782 then 583
when 312020 then 584
when 246982 then 585
when 246981 then 586
when 225354 then 587
when 225358 then 588
when 225341 then 589
when 285927 then 590
when 285928 then 591
when 135268 then 592
when 163201 then 593
when 164797 then 594
when 164796 then 595
when 165333 then 596
when 143805 then 597
when 134427 then 598
when 110301 then 599
when 125632 then 600
when 141289 then 601
when 124625 then 602
when 103424 then 603
when 246976 then 604
when 246975 then 605
when 327064 then 606
when 309812 then 607
when 164757 then 608
when 261119 then 609
when 273559 then 610
when 143085 then 611
when 225311 then 612
when 302734 then 613
when 287593 then 614
when 287604 then 615
when 287599 then 616
when 140144 then 617
when 144857 then 618
when 164762 then 619
when 161349 then 620
when 162204 then 621
when 165500 then 622
when 141243 then 623
when 164160 then 624
when 316364 then 625
when 287594 then 626
when 287595 then 627
when 300553 then 628
when 112942 then 629
when 152317 then 630
when 134176 then 631
when 326190 then 632
when 133569 then 633
when 121926 then 634
when 115012 then 635
when 122792 then 636
when 108323 then 637
when 138185 then 638
when 312019 then 639
when 123642 then 640
when 309820 then 641
when 327208 then 642
when 222650 then 643
when 326135 then 644
when 133570 then 645
when 135266 then 646
when 118436 then 647
when 148804 then 648
when 168086 then 649
when 249940 then 650
when 282191 then 651
when 283216 then 652
when 269074 then 653
when 165499 then 654
when 119915 then 655
when 309825 then 656
when 309821 then 657
when 309813 then 658
when 309814 then 659
when 107615 then 660
when 118212 then 661
when 218064 then 662
when 98069 then 663
when 121556 then 664
when 188226 then 665
when 145809 then 666
when 109221 then 667
when 263573 then 668
when 283232 then 669
when 302732 then 670
when 316420 then 671
when 111392 then 672
when 160709 then 673
when 133891 then 674
when 152691 then 675
when 193082 then 676
when 205099 then 677
when 225360 then 678
when 200478 then 679
when 278343 then 680
when 164375 then 681
when 175123 then 682
when 225315 then 683
when 225281 then 684
when 225346 then 685
when 246969 then 686
when 182338 then 687
when 228183 then 688
when 207111 then 689
when 111528 then 690
when 120734 then 691
when 116735 then 692
when 110145 then 693
when 150549 then 694
when 197399 then 695
when 228605 then 696
when 131003 then 697
when 120718 then 698
when 309328 then 699
when 330963 then 700
when 319773 then 701
when 327069 then 702
when 111812 then 703
when 152013 then 704
when 305076 then 705
when 107774 then 706
when 226058 then 707
when 228033 then 708
when 112060 then 709
when 144680 then 710
when 129845 then 711
when 167737 then 712
when 138481 then 713
when 181418 then 714
when 255884 then 715
when 251613 then 716
when 285404 then 717
when 291976 then 718
when 304957 then 719
when 309334 then 720
when 309345 then 721
when 330971 then 722
when 221041 then 723
when 239379 then 724
when 153261 then 725
when 107789 then 726
when 310294 then 727
when 326280 then 728
when 165157 then 729
when 206331 then 730
when 122422 then 731
when 283213 then 732
when 113145 then 733
when 117785 then 734
when 247539 then 735
when 132113 then 736
when 305126 then 737
when 308273 then 738
when 322570 then 739
when 325355 then 740
when 330992 then 741
when 136755 then 742
when 121469 then 743
when 195885 then 744
when 225342 then 745
when 225361 then 746
when 220316 then 747
when 152048 then 748
when 163192 then 749
when 285436 then 750
when 206743 then 751
when 168050 then 752
when 305120 then 753
when 326633 then 754
when 326632 then 755
when 326645 then 756
when 172167 then 757
when 109070 then 758
when 120342 then 759
when 129558 then 760
when 116951 then 761
when 122472 then 762
when 228604 then 763
when 291973 then 764
when 305092 then 765
when 322529 then 766
when 324879 then 767
when 326647 then 768
when 326651 then 769
when 326300 then 770
when 211893 then 771
when 208690 then 772
when 292523 then 773
when 296436 then 774
when 126190 then 775
when 189897 then 776
when 158628 then 777
when 263571 then 778
when 285396 then 779
when 285341 then 780
when 287919 then 781
when 291974 then 782
when 305598 then 783
when 308276 then 784
when 329614 then 785
when 168043 then 786
when 121649 then 787
when 116988 then 788
when 220913 then 789
when 220953 then 790
when 278436 then 791
when 138186 then 792
when 282652 then 793
when 161616 then 794
when 298861 then 795
when 203012 then 796
when 201489 then 797
when 225874 then 798
when 170126 then 799
when 117497 then 800
when 121353 then 801
when 183582 then 802
when 303655 then 803
when 138007 then 804
when 204914 then 805
when 123503 then 806
when 228595 then 807
when 228596 then 808
when 285392 then 809
when 287916 then 810
when 304809 then 811
when 308272 then 812
when 316676 then 813
when 322598 then 814
when 325308 then 815
when 324843 then 816
when 326637 then 817
when 329396 then 818
when 330968 then 819
when 331102 then 820
when 242123 then 821
when 192663 then 822
when 312197 then 823
when 319845 then 824
when 117288 then 825
when 194330 then 826
when 292684 then 827
when 202970 then 828
when 164536 then 829
when 263572 then 830
when 111813 then 831
when 169615 then 832
when 173265 then 833
when 305090 then 834
when 322531 then 835
when 323965 then 836
when 312137 then 837
when 329951 then 838
when 330248 then 839
when 330247 then 840
when 312136 then 841
when 331103 then 842
when 309633 then 843
when 136892 then 844
when 173493 then 845
when 152910 then 846
when 242122 then 847
when 211045 then 848
when 198248 then 849
when 215462 then 850
when 226057 then 851
when 175741 then 852
when 211044 then 853
when 228031 then 854
when 246970 then 855
when 281348 then 856
when 220686 then 857
when 286297 then 858
when 247586 then 859
when 285179 then 860
when 286212 then 861
when 290484 then 862
when 115033 then 863
when 191498 then 864
when 191492 then 865
when 211062 then 866
when 287918 then 867
when 323954 then 868
when 324775 then 869
when 325316 then 870
when 325305 then 871
when 325336 then 872
when 325347 then 873
when 328417 then 874
when 312138 then 875
when 58934 then 876
when 241503 then 877
when 280187 then 878
when 285821 then 879
when 293000 then 880
when 247718 then 881
when 247720 then 882
when 247669 then 883
when 285402 then 884
when 285530 then 885
when 289689 then 886
when 319850 then 887
when 326648 then 888
when 331032 then 889
when 115725 then 890
when 262081 then 891
when 322350 then 892
when 299041 then 893
when 247651 then 894
when 298716 then 895
when 299024 then 896
when 293085 then 897
when 298860 then 898
when 247791 then 899
when 247758 then 900
when 247756 then 901
when 247759 then 902
when 247765 then 903
when 247687 then 904
when 247630 then 905
when 247558 then 906
when 247535 then 907
when 285397 then 908
when 285205 then 909
when 285520 then 910
when 285533 then 911
when 285225 then 912
when 287934 then 913
when 285360 then 914
when 289749 then 915
when 290507 then 916
when 290493 then 917
when 290580 then 918
when 205434 then 919
when 324785 then 920
when 291456 then 921
when 299065 then 922
when 206995 then 923
when 176252 then 924
when 245634 then 925
when 164782 then 926
when 218382 then 927
when 246978 then 928
when 246977 then 929
when 246966 then 930
when 312196 then 931
when 121956 then 932
when 247612 then 933
when 247604 then 934
when 247708 then 935
when 247696 then 936
when 247792 then 937
when 247743 then 938
when 247678 then 939
when 247670 then 940
when 247815 then 941
when 247801 then 942
when 247790 then 943
when 247542 then 944
when 247809 then 945
when 247695 then 946
when 247700 then 947
when 285167 then 948
when 285173 then 949
when 285196 then 950
when 285521 then 951
when 285434 then 952
when 285534 then 953
when 285451 then 954
when 286247 then 955
when 287584 then 956
when 289700 then 957
when 291124 then 958
when 290566 then 959
when 290478 then 960
when 291955 then 961
when 309297 then 962
when 316672 then 963
when 312430 then 964
when 324847 then 965
when 331023 then 966
when 330989 then 967
when 330959 then 968
when 331034 then 969
when 331053 then 970
when 331048 then 971
when 277883 then 972
when 277881 then 973
when 277884 then 974
when 286300 then 975
when 181414 then 976
when 247561 then 977
when 268471 then 978
when 268294 then 979
when 268289 then 980
when 268330 then 981
when 268379 then 982
when 267756 then 983
when 267704 then 984
when 267770 then 985
when 277910 then 986
when 280866 then 987
when 281747 then 988
when 281745 then 989
when 283238 then 990
when 312423 then 991
when 163276 then 992
when 178694 then 993
when 226053 then 994
when 120222 then 995
when 297070 then 996
when 147840 then 997
when 179649 then 998
when 228112 then 999
when 292005 then 1000
else 1000
end as ranking,
max(a.non_invt) as non_invt,sum(qoh + qc) as available,max(a.dept) as dept,max(a.brand) as brand,max(a.of3) as of3,case when sum(qoh + qc) > 0 then 1 else 0 end as instock
FROM web_all_products a WITH (NOLOCK)
INNER JOIN dbo.tb_skus b WITH (NOLOCK) ON (a.style_id = b.style_id)
INNER JOIN dbo.tb_sku_buckets c WITH (NOLOCK) ON (b.sku_id = c.sku_id and c.store_id in (10,32))
INNER JOIN dbo.tb_styles_web_taxonomy d WITH (NOLOCK) ON (a.style_id = d.style)
INNER JOIN dbo.tb_styles qq WITH (NOLOCK) ON (qq.style_id = a.style_id)
where a.style_id in (197889,110158,228607,242383,247575,287570,120379,208966,133828,221027,267856,279955,287580,279956,225296,208960,225274,111344,115867,279938,278428,279973,278396,289754,278355,280197,268320,221016,281189,267874,278402,305601,280021,280022,280191,280192,316702,247804,268269,268338,278353,281398,247750,247805,267815,268306,268313,278404,278394,281228,285841,221025,280014,279987,225343,247785,247811,285440,268285,282177,286228,247781,267847,267851,267868,267880,267840,267842,267865,268316,268304,277914,278419,278391,279959,281185,280163,247829,247769,286222,279960,242411,247761,144019,267861,268259,268286,279965,279972,279958,247748,285519,290504,215419,298051,285810,267870,267877,267809,267812,267834,268332,268463,268351,268343,267866,277902,278385,278424,278377,278372,280013,280156,280154,280864,281227,281740,281413,282153,280198,283350,283354,283348,279998,247746,247581,289758,286210,225271,267888,267871,267872,267855,268301,268275,268282,268260,278361,278356,279993,279957,281263,281744,285872,285874,287920,225319,247796,247795,247799,247784,247776,285157,285204,286225,285802,290522,278368,267806,267813,267808,268318,268280,268326,268310,279940,281255,285854,282143,289013,291923,242378,242387,247735,247806,247775,285439,286183,286192,287913,289735,290680,290683,290795,291060,290527,291044,267879,268274,268261,268309,268298,278359,279980,279942,280196,280155,280195,281229,285856,286229,309635,268314,268307,277892,277887,280164,281207,281426,282148,279941,283365,228609,242390,247663,247744,247733,247740,247803,247585,285192,285377,285384,286224,286194,287917,289727,289767,290731,290688,291111,291067,290531,290510,290488,267822,267881,267876,268311,268272,282169,283352,283367,116994,242417,247771,285406,285170,285171,285174,285373,285343,287586,289765,289769,107981,277915,279961,298730,298749,299059,247754,247774,247780,247583,285198,285199,285345,285502,287921,290520,290515,290803,291082,291041,291874,292976,280836,247731,247550,247654,285176,285517,287565,289759,290518,290720,291079,291091,279991,280158,298702,225317,225365,328610,228585,285357,285154,286223,290817,290820,290586,291878,247797,287927,287585,290722,290793,281418,298688,207519,109162,268303,298721,285184,289016,289006,307898,285823,287566,207525,207522,277888,280023,298743,286230,247549,288126,309609,305084,289003,289009,289332,291889,297406,298071,290674,197639,309305,330984,331043,331037,228587,288144,289374,290596,290475,291875,294943,298072,300614,301152,307727,307787,307790,247813,329952,225303,285959,288169,289757,291723,296466,298060,298988,307700,307862,288076,288147,288887,288117,291900,294957,310323,316696,330985,277580,291744,291913,296553,297380,307879,247779,305045,307755,331041,331038,138332,290481,291743,291915,300613,305041,309322,316664,211441,285922,288044,288133,289346,290653,294956,296464,297363,299031,300617,108023,310314,322496,298741,288055,290588,290706,291745,294964,296455,296616,298053,299067,225293,305109,305073,319839,322625,225307,311646,211437,285924,288066,291747,291746,296615,211438,221023,220950,225352,252017,305002,305078,309313,310317,322588,325331,325329,298740,164783,288080,291742,292039,292038,296458,322572,325358,325321,225331,305104,322586,330986,211442,297892,211434,310285,193570,222565,225308,305082,309318,309317,305052,114695,123645,222584,211439,123628,225353,191514,325233,172841,288170,325292,319929,118213,221032,221029,122332,149682,123646,292981,289418,206749,221037,135306,222573,297390,117142,220924,179760,170534,200030,225314,293063,215192,173177,133629,193444,293106,293099,225305,288073,292041,325208,166566,184037,133164,131095,116993,292987,235830,211440,297412,325298,110026,293071,293069,293070,211891,136716,179239,129957,296569,329580,194353,220982,246974,192759,220932,225327,309606,148510,164665,122439,167704,163144,110017,133830,114911,134157,158524,101976,164978,164711,327075,164979,163268,121358,144858,143881,152316,164336,316708,133411,138209,164015,164667,164929,164666,136701,167701,168148,168100,329516,133921,134432,115743,144859,136638,134542,158514,193195,327066,327067,137242,133782,312020,246982,246981,225354,225358,225341,285927,285928,135268,163201,164797,164796,165333,143805,134427,110301,125632,141289,124625,103424,246976,246975,327064,309812,164757,261119,273559,143085,225311,302734,287593,287604,287599,140144,144857,164762,161349,162204,165500,141243,164160,316364,287594,287595,300553,112942,152317,134176,326190,133569,121926,115012,122792,108323,138185,312019,123642,309820,327208,222650,326135,133570,135266,118436,148804,168086,249940,282191,283216,269074,165499,119915,309825,309821,309813,309814,107615,118212,218064,98069,121556,188226,145809,109221,263573,283232,302732,316420,111392,160709,133891,152691,193082,205099,225360,200478,278343,164375,175123,225315,225281,225346,246969,182338,228183,207111,111528,120734,116735,110145,150549,197399,228605,131003,120718,309328,330963,319773,327069,111812,152013,305076,107774,226058,228033,112060,144680,129845,167737,138481,181418,255884,251613,285404,291976,304957,309334,309345,330971,221041,239379,153261,107789,310294,326280,165157,206331,122422,283213,113145,117785,247539,132113,305126,308273,322570,325355,330992,136755,121469,195885,225342,225361,220316,152048,163192,285436,206743,168050,305120,326633,326632,326645,172167,109070,120342,129558,116951,122472,228604,291973,305092,322529,324879,326647,326651,326300,211893,208690,292523,296436,126190,189897,158628,263571,285396,285341,287919,291974,305598,308276,329614,168043,121649,116988,220913,220953,278436,138186,282652,161616,298861,203012,201489,225874,170126,117497,121353,183582,303655,138007,204914,123503,228595,228596,285392,287916,304809,308272,316676,322598,325308,324843,326637,329396,330968,331102,242123,192663,312197,319845,117288,194330,292684,202970,164536,263572,111813,169615,173265,305090,322531,323965,312137,329951,330248,330247,312136,331103,309633,136892,173493,152910,242122,211045,198248,215462,226057,175741,211044,228031,246970,281348,220686,286297,247586,285179,286212,290484,115033,191498,191492,211062,287918,323954,324775,325316,325305,325336,325347,328417,312138,58934,241503,280187,285821,293000,247718,247720,247669,285402,285530,289689,319850,326648,331032,115725,262081,322350,299041,247651,298716,299024,293085,298860,247791,247758,247756,247759,247765,247687,247630,247558,247535,285397,285205,285520,285533,285225,287934,285360,289749,290507,290493,290580,205434,324785,291456,299065,206995,176252,245634,164782,218382,246978,246977,246966,312196,121956,247612,247604,247708,247696,247792,247743,247678,247670,247815,247801,247790,247542,247809,247695,247700,285167,285173,285196,285521,285434,285534,285451,286247,287584,289700,291124,290566,290478,291955,309297,316672,312430,324847,331023,330989,330959,331034,331053,331048,277883,277881,277884,286300,181414,247561,268471,268294,268289,268330,268379,267756,267704,267770,277910,280866,281747,281745,283238,312423,163276,178694,226053,120222,297070,147840,179649,228112,292005)
and ltrim(rtrim(lower(a.brand))) = 'taurus'
and a.of3='44 SPECIAL'
group by a.style_id
order by instock desc, ranking asc
|