Re: [SQL] DIVISION with Group By

2008-12-09 Thread Richard Huxton
hdhgdh mjhff wrote: > Hai all, > > I am new to SQL coding. > I need some help in writing SQL > In my task i have to calculate division of two sub queries. > each sub query has its own group by clause. Can you provide a simpler example? It's not obvious to me what you're trying to do. -- Richa

[SQL] DIVISION with Group By

2008-12-01 Thread hdhgdh mjhff
Hai all, I am new to SQL coding. I need some help in writing SQL In my task i have to calculate division of two sub queries. each sub query has its own group by clause. Here with i have Paste my table information and my SQL. /* tdos table */ CREATE TABLE tdos ( dosid integer NOT NULL DEFAULT

Re: [SQL] Division in Postgre

2005-05-01 Thread hatuan
Thank you - Original Message - From: "Stephan Szabo" <[EMAIL PROTECTED]> To: "tuan" <[EMAIL PROTECTED]> Cc: Sent: Saturday, April 30, 2005 10:56 AM Subject: Re: [SQL] Division in Postgre > On Sun, 24 Apr 2005, tuan wrote: > > > In sql serv

Re: [SQL] Division in Postgre

2005-04-29 Thread Stephan Szabo
On Sun, 24 Apr 2005, tuan wrote: > In sql server my division select cast(3 as float)/10 is 0.299. > But in postgres select cast(3 as float8)/10 is 0.3. How to get result like > sql server? I believe you can control what precision is used in printing the float results with extra_float_digi

[SQL] Division in Postgre

2005-04-29 Thread tuan
In sql server my division select cast(3 as float)/10 is 0.299. But in postgres select cast(3 as float8)/10 is 0.3. How to get result like sql server? Thank you. Sorry for my english ---(end of broadcast)--- TIP 5: Have you checked our extensi

Re: [SQL] Division

2000-09-18 Thread Jie Liang
Hi, there, I don't quit sure what you really want to solve, however, if you use EXCEPT results1 and result2 should be same type rather than tables, i.e. select a,b from tab1 except select c,d from tab2; a,c are same type b,d are same type. notes, EXCEPT to big table is not efficient, so does IN

[SQL] Division

2000-09-18 Thread Bernie Huang
Hi, I tried the write up the following SQL statement: result1 from sql1 = (1,2,3,4,5) result2 from sql2 = (4,5) result3 = result1/result2 (or is it result2/result1) = (1,2,3) What do I have to do to get the (1,2,3) result? I tried "query EXCEPT query", but it seems like EXCEPT needs both table