Jump to content
tchuss

Presta 1.6 SQL erreur checkedWhere [résolu]

Recommended Posts

Bonjour, en essayant de faire un inner join sur la 1.6.1.9, j'ai le joli message Erreur non définie "checkedWhere"

La requête fonctionne parfaitement sur phpmyadmin, je souhaitais récupérer l'adresse email client en filtrant par ville :

 

SELECT psla_customer.lastname,psla_customer.firstname,psla_customer.email FROM psla_customer INNER JOIN psla_address WHERE psla_address.id_customer = psla_customer.id_customer AND psla_address.city = "Paris";

 

Avez-vous déjà rencontré ce problème, avez-vous une autre requête en tête pour le même résultat ?

Edited by tchuss (see edit history)

Share this post


Link to post
Share on other sites

Ben ça ne s'écrit pas comme ça^^

 

SELECT psla_customer.lastname,psla_customer.firstname,psla_customer.email

FROM psla_customer

INNER JOIN psla_address ON( psla_address.id_customer = psla_customer.id_customer AND psla_address.city = "Paris");

Share this post


Link to post
Share on other sites

Salut, je viens de tester ta réponse et toujours pareil Erreur non définie "checkedFrom"

Elle passe chez toi ?

Share this post


Link to post
Share on other sites

Ca, ça marche sur mes boutiques

SELECT c.lastname,c.firstname,c.email
FROM ps_customer c
INNER JOIN ps_address a ON( a.id_customer = c.id_customer AND a.city = "Paris")
GROUP BY c.id_customer

Share this post


Link to post
Share on other sites

Super, avec cette syntaxe ça fonctionne, stricte prestashop...phpmyadmin acceptait ma formulation :P

 

Merci ! :)

Share this post


Link to post
Share on other sites

J'ai le meme soucis avec cette requete 

select  id_order, product_name, total_price_tax_incl, total_price_tax_excl, ps_orders.invoice_date, ps_orders.total_paid_tax_incl, ps_orders.total_paid_tax_excl
from ps_orders INNER JOIN ps_order_detail ON (ps_order_detail.id_order = ps_orders.id_order)
Where invoice_date BETWEEN '2018-01-01' AND '2018-05-31' 
GROUP BY ps_orders.id_order

Share this post


Link to post
Share on other sites

Essaye ça:

select  ps_orders.id_order, product_name, total_price_tax_incl, total_price_tax_excl, ps_orders.invoice_date, ps_orders.total_paid_tax_incl, ps_orders.total_paid_tax_excl
from ps_orders 
INNER JOIN ps_order_detail ON (ps_order_detail.id_order = ps_orders.id_order)
Where invoice_date BETWEEN '2018-01-01' AND '2018-05-31' 
GROUP BY ps_orders.id_order

Share this post


Link to post
Share on other sites

J'ai trouve merci 

j'ai mis un alias sur toutes les tables et ca fonctionne 

select  d.id_order, a.lastname, a.firstname, c.email, a.city, p.name, Concat("#FA" , LPAD(o.invoice_number,5,'0')), o. payment, o.invoice_date, o.total_paid_tax_incl, o.total_paid_tax_excl, 
d.product_name, d.total_price_tax_incl, d.total_price_tax_excl
from  ps_orders as o inner join ps_order_detail as d on (o.id_order = d.id_order)
    inner join ps_address as a on (a.id_address = o.id_address_invoice and o.id_customer = a.id_customer)
    inner join ps_customer as c on (o.id_customer = c.id_customer)
    inner join ps_country_lang as p on (p.id_country = a.id_country)
WHERE o.invoice_date BETWEEN '2018-01-01' AND '2018-05-31'

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More