我有一个任务数据库:
我需要检索结束日期最多为今天+ 7天的任务。例如,如果我有一个03/01/2018结束日期的任务,今天是03/10/2018它不应该出现。但如果任务已于03/06/2018结束日期,是的。当然,所有结束日期优于今天的任务必须出现在列表中。
我可以通过SQL查询实现这一点,还是应该通过编程语言实现?感谢。
答案 0 :(得分:1)
试试这个:
SELECT *
FROM `tasks`
WHERE end_date>= CURRENT_DATE - INTERVAL 7 DAY;
答案 1 :(得分:0)
Information:Gradle tasks [:app:clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:assembleDebug]
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2400Library
:app:prepareComAndroidSupportAppcompatV72400Library
:app:prepareComAndroidSupportMediarouterV72400Library
:app:prepareComAndroidSupportPaletteV72400Library
:app:prepareComAndroidSupportSupportV42400Library
:app:prepareComAndroidSupportSupportVectorDrawable2400Library
:app:prepareComGoogleAndroidGmsPlayServices1001Library
:app:prepareComGoogleAndroidGmsPlayServicesAds1001Library
:app:prepareComGoogleAndroidGmsPlayServicesAdsLite1001Library
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics1001Library
:app:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl1001Library
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite1001Library
:app:prepareComGoogleAndroidGmsPlayServicesAuth1001Library
:app:prepareComGoogleAndroidGmsPlayServicesAuthBase1001Library
:app:prepareComGoogleAndroidGmsPlayServicesAwareness1001Library
:app:prepareComGoogleAndroidGmsPlayServicesBase1001Library
:app:prepareComGoogleAndroidGmsPlayServicesBasement1001Library
:app:prepareComGoogleAndroidGmsPlayServicesCast1001Library
:app:prepareComGoogleAndroidGmsPlayServicesCastFramework1001Library
:app:prepareComGoogleAndroidGmsPlayServicesClearcut1001Library
:app:prepareComGoogleAndroidGmsPlayServicesDrive1001Library
:app:prepareComGoogleAndroidGmsPlayServicesFitness1001Library
:app:prepareComGoogleAndroidGmsPlayServicesGames1001Library
:app:prepareComGoogleAndroidGmsPlayServicesGass1001Library
:app:prepareComGoogleAndroidGmsPlayServicesGcm1001Library
:app:prepareComGoogleAndroidGmsPlayServicesIdentity1001Library
:app:prepareComGoogleAndroidGmsPlayServicesIid1001Library
:app:prepareComGoogleAndroidGmsPlayServicesInstantapps1001Library
:app:prepareComGoogleAndroidGmsPlayServicesLocation1001Library
:app:prepareComGoogleAndroidGmsPlayServicesMaps1001Library
:app:prepareComGoogleAndroidGmsPlayServicesNearby1001Library
:app:prepareComGoogleAndroidGmsPlayServicesPanorama1001Library
:app:prepareComGoogleAndroidGmsPlayServicesPlaces1001Library
:app:prepareComGoogleAndroidGmsPlayServicesPlus1001Library
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet1001Library
:app:prepareComGoogleAndroidGmsPlayServicesTagmanager1001Library
:app:prepareComGoogleAndroidGmsPlayServicesTagmanagerApi1001Library
:app:prepareComGoogleAndroidGmsPlayServicesTagmanagerV4Impl1001Library
:app:prepareComGoogleAndroidGmsPlayServicesTasks1001Library
:app:prepareComGoogleAndroidGmsPlayServicesVision1001Library
:app:prepareComGoogleAndroidGmsPlayServicesWallet1001Library
:app:prepareComGoogleAndroidGmsPlayServicesWearable1001Library
:app:prepareComGoogleFirebaseFirebaseAnalytics1001Library
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl1001Library
:app:prepareComGoogleFirebaseFirebaseAppindexing1001Library
:app:prepareComGoogleFirebaseFirebaseAuth1001Library
:app:prepareComGoogleFirebaseFirebaseCommon1001Library
:app:prepareComGoogleFirebaseFirebaseConfig1001Library
:app:prepareComGoogleFirebaseFirebaseCrash1001Library
:app:prepareComGoogleFirebaseFirebaseDatabase1001Library
:app:prepareComGoogleFirebaseFirebaseDatabaseConnection1001Library
:app:prepareComGoogleFirebaseFirebaseIid1001Library
:app:prepareComGoogleFirebaseFirebaseMessaging1001Library
:app:prepareComGoogleFirebaseFirebaseStorage1001Library
:app:prepareComGoogleFirebaseFirebaseStorageCommon1001Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
D:\GoogleMap\app\src\main\AndroidManifest.xml:33:5-35:23 Warning:
Element uses-permission#android.permission.ACCESS_FINE_LOCATION at AndroidManifest.xml:33:5-35:23 duplicated with element declared at AndroidManifest.xml:10:5-79
:app:processDebugResources
:app:generateDebugSources
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl
:app:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:app:mergeDebugAndroidTestShaders
:app:compileDebugAndroidTestShaders
:app:generateDebugAndroidTestAssets
:app:mergeDebugAndroidTestAssets
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources
:app:mockableAndroidJar UP-TO-DATE
:app:preDebugUnitTestBuild UP-TO-DATE
:app:prepareDebugUnitTestDependencies
:app:incrementalDebugJavaCompilationSafeguard
:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
D:\GoogleMap\app\src\main\java\com\ite\googlemap\MapsActivity.java
Error:(23, 86) error: cannot find symbol method getMap()
:app:compileDebugJavaWithJavac FAILED
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.