2017-10-17 4 views
0

マゼンタで特定の注文をした顧客の性別をSQLまたはテーブルの関係で検索します。私のデータベースでマゼンタで注文したお客様の性別

+0

何WHERE increment_id = "100000XXXX" 'sales_flat_order FROM customer_prefixを選択 について;' ' –

+0

customer_prefix'列がnullです。私は顧客の性別を得ることができる他の方法はありますか? – Dilani

答えて

0

それは次のとおりです。

SELECT t0.entity_id, t1.value 
FROM customer_entity AS t0 
INNER JOIN (
    SELECT t2.entity_id, t2.value 
    FROM customer_entity_int AS t2 
    WHERE (t2.attribute_id = 18) 
) AS t1 
    ON (t0.entity_id = t1.entity_id) 

あなたattribute_id = 18は異なる場合があります。あなたが上でそれを見つける必要があり

SELECT t1.attribute_id, t1.attribute_code, t1.backend_type 
FROM eav_entity_type AS t0 
INNER JOIN eav_attribute AS t1 
    ON (t0.entity_type_id = t1.entity_type_id) 
WHERE (t0.entity_model = @p0) 
-- p0 = [customer/customer] 
関連する問題