Последовательное использование запасов в sql server

Из-за высокой плотности новых устройств, таких как Nexus 5X, Nexus 6P и Samsung Galaxy S6, нам пришлось адаптировать манифест следующим образом:

<compatible-screens>
    <screen android:screenSize="small" android:screenDensity="ldpi" />
    <screen android:screenSize="small" android:screenDensity="mdpi" />
    <screen android:screenSize="small" android:screenDensity="hdpi" />
    <screen android:screenSize="small" android:screenDensity="xhdpi" />
    <screen android:screenSize="small" android:screenDensity="420" />
    <screen android:screenSize="small" android:screenDensity="480" />
    <screen android:screenSize="small" android:screenDensity="560" />
    <screen android:screenSize="small" android:screenDensity="640" />
    <screen android:screenSize="normal" android:screenDensity="ldpi" />
    <screen android:screenSize="normal" android:screenDensity="mdpi" />
    <screen android:screenSize="normal" android:screenDensity="hdpi" />
    <screen android:screenSize="normal" android:screenDensity="xhdpi" />
    <screen android:screenSize="normal" android:screenDensity="420" />
    <screen android:screenSize="normal" android:screenDensity="480" />
    <screen android:screenSize="normal" android:screenDensity="560" />
    <screen android:screenSize="normal" android:screenDensity="640" />
    <screen android:screenSize="large" android:screenDensity="ldpi" />
    <screen android:screenSize="large" android:screenDensity="mdpi" />
    <screen android:screenSize="large" android:screenDensity="hdpi" />
    <screen android:screenSize="large" android:screenDensity="xhdpi" />
    <screen android:screenSize="large" android:screenDensity="420" />
    <screen android:screenSize="large" android:screenDensity="480" />
    <screen android:screenSize="large" android:screenDensity="560" />
    <screen android:screenSize="large" android:screenDensity="640" />
</compatible-screens>
1
задан Ljt 16 January 2019 в 15:09
поделиться

1 ответ

Edit - Re-Thunk'd It

Пример

Declare @Order table(  Id int,[From] int,[To] int )
Insert Into @Order Values 
(1,100,400),
(2,401,600),
(3,601,1000),
(4,1001,2000)

Declare @first int=300, @last int=900

Select A.*
      ,[Start] = case when [From]>@First then [From] else @First end
      ,[End]   = case when @Last <[To] then @Last else [To] end
 From  @Order A
 Where [To] between @First and @Last
    or @Last between [From] and [To] 

Возвраты

Id  From    To      Start   End
1   100     400     300     400
2   401     600     401     600
3   601     1000    601     900
0
ответ дан John Cappelletti 16 January 2019 в 15:09
поделиться
Другие вопросы по тегам:

Похожие вопросы: