使用apache derby在delete语句上进行内连接

时间:2017-12-10 21:11:31

标签: apache derby

我使用以下语法选择所需的行:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="id.infision.dev.farminformationsystemhybrid"
    xmlns:tool="http://schemas.android.com/tools"


    android:versionCode="1"
    android:versionName="1.0"

    >


    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

    <uses-permission android:name="id.infision.dev.farminformationsystemhybrid.permission.MAPS_RECEIVE"/>
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
    <uses-permission android:name="android.permission.CAMERA" />


    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true"/>

    <permission
        android:name="com.example.permission.MAPS_RECEIVE"
        android:protectionLevel="signature"/>


    <uses-sdk
        android:minSdkVersion="19"
        android:targetSdkVersion="27" />


    <application
        android:name=".app.AppController"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tool:replace="android:icon">

        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="@string/google_maps_key"
            />


        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version"
            />


        <activity
            android:name=".activity.Splashscreen"
            android:label="@string/app_name"
            android:launchMode="singleTop"
            android:windowSoftInputMode="adjustPan">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activity.LoginActivity"
            android:label="@string/app_name"
            android:launchMode="singleTop"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".activity.RegisterActivity"
            android:label="@string/app_name"
            android:launchMode="singleTop"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".activity.Login_main"
            android:label="@string/app_name"
            android:launchMode="singleTop" />
        <activity
            android:name=".activity.MainActivity"
            android:label="@string/title_activity_main"
            android:theme="@style/AppTheme.NoActionBar"></activity>

    </application>      

我应该使用什么语法删除同一行?

1 个答案:

答案 0 :(得分:1)

您可以将DELETE statment与IN运算符一起使用:

DELETE FROM Customer_Coupon WHERE COUPON_ID IN (
   SELECT COUPON_ID FROM Customer_Coupon INNER JOIN Company_Coupon ON
   Customer_Coupon.COUPON_Id =Company_Coupon.COUPON_Id WHERE COMP_Id = 123
);

这将删除Customer_Coupon表中内部SELECT返回COUPON_ID的所有行。