Re: [SQL] Nested select

2006-11-07 Thread Aaron Bono
On 11/6/06, Hubert Retif [EMAIL PROTECTED] wrote: I am migrating my application from MySQL to Postgresql and have met following situation: SELECT (sum(sold_price)/(select sum(sold_price) from car_archive))*100 as CA_pcent, reason_text FROM car_archive group by reason_text order by CA_pcent

Re: [SQL] Nested select

2006-11-07 Thread Scott Marlowe
On Mon, 2006-11-06 at 05:08, Hubert Retif wrote: Hi, I am migrating my application from MySQL to Postgresql and have met following situation: SELECT (sum(sold_price)/(select sum(sold_price) from car_archive))*100 as CA_pcent, reason_text FROM car_archive group by reason_text

[SQL] Nested select

2006-11-06 Thread Hubert Retif
Hi, I am migrating my application from MySQL to Postgresql and have met following situation: SELECT (sum(sold_price)/(select sum(sold_price) from car_archive))*100 as CA_pcent, reason_text FROM car_archive group by reason_text order by CA_pcent desc works perfectly in MySQL,

Re: [SQL] Nested select

2006-11-06 Thread imad
Can you write the error message here? --Imad www.EnterpriseDB.com On 11/6/06, Hubert Retif [EMAIL PROTECTED] wrote: Hi, I am migrating my application from MySQL to Postgresql and have met following situation: SELECT (sum(sold_price)/(select sum(sold_price) from car_archive))*100 as

Re: [SQL] Nested select

2006-11-06 Thread Tom Lane
=?us-ascii?Q?Hubert_Retif?= [EMAIL PROTECTED] writes: I am migrating my application from MySQL to Postgresql and have met following situation: ... works perfectly in MySQL, but not in Postgresql. If you want useful help, you need to explain exactly what results you got and what you expected

Re: [SQL] nested select within a DISTINCT block

2006-09-22 Thread Bruno Wolff III
On Thu, Sep 14, 2006 at 05:02:25 -0700, zqzuk [EMAIL PROTECTED] wrote: Hi, here i have a problem with this task... I have a table cancellation which stores cancelled bookings and details of charges etc and a table bookings which stores details of bookings, for example:

[SQL] nested select within a DISTINCT block

2006-09-16 Thread zqzuk
Hi, here i have a problem with this task... I have a table cancellation which stores cancelled bookings and details of charges etc and a table bookings which stores details of bookings, for example: cancellation(cancellation_id, booking_id, charge) booking(booking_id, customer_id,

[SQL] nested select within a DISCTINCT block

2006-09-14 Thread zqzuk
Hi, here i have a problem with this task... I have a table cancellation which stores cancelled bookings and details of charges etc and a table bookings which stores details of bookings, for example: cancellation(cancellation_id, booking_id, charge) booking(booking_id, customer_id,

Re: [SQL] nested select within a DISCTINCT block

2006-09-14 Thread Daryl Richter
On 9/14/06 1:13 PM, zqzuk [EMAIL PROTECTED] wrote: Hi, here i have a problem with this task... I have a table cancellation which stores cancelled bookings and details of charges etc and a table bookings which stores details of bookings, for example: cancellation(cancellation_id,

Re: [SQL] nested select within a DISCTINCT block

2006-09-14 Thread zqzuk
Thanks alot!!! Daryl Richter-2 wrote: On 9/14/06 1:13 PM, zqzuk [EMAIL PROTECTED] wrote: Hi, here i have a problem with this task... I have a table cancellation which stores cancelled bookings and details of charges etc and a table bookings which stores details of bookings, for

Re: [SQL] nested select within a DISCTINCT block

2006-09-14 Thread Niklas Johansson
On 14 sep 2006, at 23.58, Daryl Richter wrote: create table booking(booking_id int, customer_id int, product_package_id int, details text); create table cancellation(cancellation_id int , booking_id int, charge decimal); insert into booking values( 1, 1, 1, 'Cxl Booking 1' ); insert into