1
これは私のquery.when私はこのクエリのdescで順序を追加すると、エラーが表示されますpls助けてください。次の順番でMysqlエラーが発生します
SELECT *
FROM
(SELECT package_details.*,
r.state AS source_name,
d.state AS dest_name
FROM (`package_details`)
LEFT JOIN country_state_city r ON r.id=package_details.region_id
LEFT JOIN country_state_city d ON d.id=package_details.destination_id
WHERE `package_availability_type` = 'all'
AND `admin_status` = 'ACTIVE'
AND `status` = 'ACTIVE'
AND (package_name LIKE '%Istanbul%'
OR routes LIKE '%Istanbul%'
OR r.state LIKE '%Istanbul%'
OR d.state LIKE '%Istanbul%')
AND
ORDER BY `package_price` DESC
UNION ALL SELECT package_details.*,
r.state AS source_name,
d.state AS dest_name
FROM (`package_details`)
LEFT JOIN country_state_city r ON r.id=package_details.region_id
LEFT JOIN country_state_city d ON d.id=package_details.destination_id
WHERE `package_availability_type` ='range'
AND `admin_status` = 'ACTIVE'
AND `status` = 'ACTIVE'
AND `to_date` >= '2017-02-07'
AND (package_name LIKE '%Istanbul%'
OR routes LIKE '%Istanbul%'
OR r.state LIKE '%Istanbul%'
OR d.state LIKE '%Istanbul%')
AND
ORDER BY `package_price` DESC) AS dt LIMIT 0,100
エラー: あなたのSQL構文でエラーが発生しています。 'package_price
DESC UNION ALL SELECTのpackage_details BY ORDER *、r.state AS酸っぱい' 近くを使用する権利構文についてはMySQLサーバのバージョンに対応するマニュアルを確認してくださいラインで1