sql >> データベース >  >> RDS >> Mysql

MySQLがJOINplusORDERで主キーを使用しないのはなぜですか?

    このバージョンを試すことができますか(基本的に、最初にcorderの420行を取得します テーブル、それらの20を保持し、次に3つの外部結合を実行します):

    SELECT
        corder.id,
        corder.public_id,
        CONCAT(buyer.fname," ",buyer.lname) AS buyer_name,
        corder.status,
        corder.payment,
        corder.reserved AS R,
        corder.tracking_id != "" AS A,
        corder.payment_received AS pay_date,
        invoice.invoice_no AS inv,
        invoice.receipt_no AS rec,
        invoice.public AS pub_inv,
        proforma.proforma_no AS prof,
        proforma.public AS pub_pf,
        corder.rating,
        corder.rating_comments!="" AS got_comment
    FROM
        ( SELECT * 
          FROM corder
          ORDER BY
            id DESC 
          LIMIT 400, 20
        )
        AS corder
    LEFT JOIN user as buyer ON buyer.id = corder.buyer
    LEFT JOIN invoice AS invoice ON invoice.id = corder.invoice
    LEFT JOIN invoice AS proforma ON proforma.id = corder.proforma
    ORDER BY
        corder.id DESC ;
    



    1. Solrでこの種の機能が機能しないのはなぜですか?

    2. SpringBootsapplication.propertiesを使用したJDBCフェッチサイズの最適化

    3. 2つの列で同じ値を持つ2つの行を結合します

    4. ユーザーログオン時のPostgresqlトリガー