Reply to Nested SELECT in SELECT clause works in MySQL 3 and not in MySQL 4

Your name:

Reply:


Posted by Cook on 10/14/19 11:36

Hello,

I have a problem to migrate a software to MySQL 4 the request below
works perfectly with MySQL 3 and not with MySQL 4. If somebody jave
any idea.

Thanks.

WITH MySQL 3.23.56 :
--------------------------------------


Affichage des enregistrements 0 - 10 (11 total)

SELECT c.coupon_id, c.coupon_code, c.coupon_amount, c.coupon_type,
c.coupon_start_date, c.coupon_expire_date, c.coupon_minimum_order,
c.coupon_minimum_total_orders, c.uses_per_user, c.uses_per_coupon,
c.restrict_to_products, c.restrict_to_categories,
c.restrict_to_customers, c.restrict_to_existings_customers,
date_created, date_modified, (

SELECT count( * )
FROM coupon_email_track AS et
WHERE c.coupon_id = et.coupon_id
) AS email_count
FROM coupons c
WHERE c.coupon_active = 'Y' AND c.coupon_type = 'G'
ORDER BY c.date_created DESC



WITH MySQL 4.0.25
---------------------------------


Error

SQL query:

SELECT c.coupon_id, c.coupon_code, c.coupon_amount, c.coupon_type,
c.coupon_start_date, c.coupon_expire_date, c.coupon_minimum_order,
c.coupon_minimum_total_orders, c.uses_per_user, c.uses_per_coupon,
c.restrict_to_products, c.restrict_to_categories,
c.restrict_to_customers, c.restrict_to_existings_customers,
date_created, date_modified, (

SELECT count( * )
FROM coupon_email_track AS et
WHERE c.coupon_id = et.coupon_id
) AS email_count
FROM coupons c
WHERE c.coupon_active = 'Y'
AND c.coupon_type = 'G'
ORDER BY c.date_created DESC

MySQL said:
#1064 - You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'select count(*) from coupon_email_track as et where c.coupon_id

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация