你好,我有这张桌子:
3:55:52 PM: Executing task 'assembleDebug'...
Executing tasks: [assembleDebug]
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to C:\Users\admin\AppData\Local\Android\Sdk\ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to C:\Users\admin\AppData\Local\Android\Sdk\ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
:app:checkDemoProductionDebugClasspath UP-TO-DATE
:app:preBuild UP-TO-DATE
:errorcheckmodule:preBuild UP-TO-DATE
:errorcheckmodule:preDebugBuild UP-TO-DATE
:errorcheckmodule:checkDebugManifest UP-TO-DATE
:errorcheckmodule:processDebugManifest UP-TO-DATE
:app:preDemoProductionDebugBuild UP-TO-DATE
:errorcheckmodule:compileDebugAidl NO-SOURCE
:app:compileDemoProductionDebugAidl NO-SOURCE
:errorcheckmodule:packageDebugRenderscript NO-SOURCE
:app:compileDemoProductionDebugRenderscript UP-TO-DATE
:app:checkDemoProductionDebugManifest UP-TO-DATE
:app:generateDemoProductionDebugBuildConfig UP-TO-DATE
:app:mainApkListPersistenceDemoProductionDebug UP-TO-DATE
:app:mergeDemoProductionDebugShaders UP-TO-DATE
:app:compileDemoProductionDebugShaders UP-TO-DATE
:app:generateDemoProductionDebugAssets UP-TO-DATE
:errorcheckmodule:mergeDebugShaders UP-TO-DATE
:errorcheckmodule:compileDebugShaders UP-TO-DATE
:errorcheckmodule:generateDebugAssets UP-TO-DATE
:errorcheckmodule:packageDebugAssets UP-TO-DATE
:app:mergeDemoProductionDebugAssets UP-TO-DATE
:app:processDemoProductionDebugGoogleServices
Parsing json file: C:\Users\admin\Desktop\masters\app\google-services.json
:app:createDemoProductionDebugCompatibleScreenManifests UP-TO-DATE
:app:processDemoProductionDebugManifest
:app:fabricGenerateResourcesDemoProductionDebug
:app:generateDemoProductionDebugResValues UP-TO-DATE
:app:generateDemoProductionDebugResources UP-TO-DATE
:errorcheckmodule:compileDebugRenderscript UP-TO-DATE
:errorcheckmodule:generateDebugResValues UP-TO-DATE
:errorcheckmodule:generateDebugResources UP-TO-DATE
:errorcheckmodule:packageDebugResources UP-TO-DATE
:app:mergeDemoProductionDebugResources
C:\Users\admin\Desktop\masters\app\build\intermediates\incremental\mergeDemoProductionDebugResources\merged.dir\values\values.xml:2601: warn: multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?.
C:\Users\admin\Desktop\masters\app\build\intermediates\incremental\mergeDemoProductionDebugResources\merged.dir\values\values.xml:2674: warn: multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?.
C:\Users\admin\Desktop\masters\app\build\intermediates\incremental\mergeDemoProductionDebugResources\merged.dir\values\values.xml:2675: warn: multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?.
:app:splitsDiscoveryTaskDemoProductionDebug UP-TO-DATE
:errorcheckmodule:generateDebugRFile UP-TO-DATE
:app:processDemoProductionDebugResources
error: string too large to encode using UTF-8 written instead as 'STRING_TOO_LARGE'.
:errorcheckmodule:generateDebugBuildConfig UP-TO-DATE
:errorcheckmodule:prepareLintJar UP-TO-DATE
:errorcheckmodule:generateDebugSources UP-TO-DATE
:errorcheckmodule:javaPreCompileDebug UP-TO-DATE
:errorcheckmodule:compileDebugJavaWithJavac UP-TO-DATE
:errorcheckmodule:processDebugJavaRes NO-SOURCE
:errorcheckmodule:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug UP-TO-DATE
:app:kaptGenerateStubsDemoProductionDebugKotlin UP-TO-DATE
e: C:\Users\admin\Desktop\masters\app\build\tmp\kapt3\stubs\demoProductionDebug\com\empowered\healo\ui\adapters\HistoryQuestionAdapter.java:155: error: incompatible types: possible lossy conversion from long to int
@android.support.annotation.IntDef(value = {1L, 0L})
^
e: C:\Users\admin\Desktop\masters\app\build\tmp\kapt3\stubs\demoProductionDebug\com\empowered\healo\ui\adapters\HistoryQuestionAdapter.java:155: error: incompatible types: possible lossy conversion from long to int
@android.support.annotation.IntDef(value = {1L, 0L})
^
:app:kaptDemoProductionDebugKotlin FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:kaptDemoProductionDebugKotlin'.
> Compilation error. See log for more details
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 29s
33 actionable tasks: 6 executed, 27 up-to-date
3:56:22 PM: Task execution finished 'assembleDebug'.
我想像这样修改此表
0001
003
02
1234
0012
我的意思是如果数字前面有零,我想将其放在正确的位置,例如0012将变为1200
非常感谢您
答案 0 :(得分:4)
您可以使用字符串操作:
select v.*,
stuff(col, 1, patindex('%[^0]%', col) - 1, '') + left(col, patindex('%[^0]%', col) - 1)
from (values ('0001'), ('003'), ('02'), ('1234')) v(col)
答案 1 :(得分:1)
只需在末尾添加4个零,然后从1-9开始提取子串:
SELECT test, SUBSTRING(test + '0000', patindex('%[1-9]%', test), LEN(test))
FROM (VALUES
('0001'),
('003'),
('02'),
('1234'),
('0012')
) AS tests(test)
要处理棘手的边缘情况,请使用:
SUBSTRING(test + '0000', ISNULL(NULLIF(patindex('%[1-9]%', test), 0), 1), LEN(test))