[SQL] Recursive select

2001-05-24 Thread Daniel Wickstrom
> "Martin" == Martin Smetak <[EMAIL PROTECTED]> writes: Martin> Hi all! Anyone know if it's possible to make a recursive Martin> select from a table ? My problem: I got a table of "some Martin> categories" which all points to its parrent Martin> one(tree)...shown below. And

[SQL] Help with 'now', now(), timestamp 'now', ...

2001-03-30 Thread Daniel Wickstrom
> "edipoelder" == edipoelder <[EMAIL PROTECTED]> writes: edipoelder> times. Then I changed the function and run, at id = edipoelder> 14. Change again at id = 15. Where is underlined edipoelder> (), i tried to put, 'now', timestamp 'now', etc, edipoelder> and always

[SQL] sum(bool)?

2001-02-23 Thread Daniel Wickstrom
> "Olaf" == Olaf Zanger <[EMAIL PROTECTED]> writes: Olaf> hi there i'd like to add up the "true" values of a Olaf> comparison like Olaf> sum(a>b) Olaf> it just doesn't work like this Olaf> any workaround Try using a case statement: select sum(case when a > b then 1 e

Re: [SQL] now() with microsecond granulity needed

2001-02-21 Thread Daniel Wickstrom
> "Radoslaw" == Radoslaw Stachowiak <[EMAIL PROTECTED]> writes: Radoslaw> *** Tom Lane <[EMAIL PROTECTED]> [Tuesday, Radoslaw> 20.February.2001, 11:57 -0500]: >> > using now() to init TIMESTAMP fields I got resolution of one >> second. How > can I define DEFAULT in column (TIM

Re: [SQL] COUNT

2000-10-19 Thread Daniel Wickstrom
> "Brian" == Brian C Doyle <[EMAIL PROTECTED]> writes: Brian> Hello, You will need to do "SELECT count(attribute) FROM Brian> table;" or SELECT count(table.attribute);" You need to watch this: acspg=# create table tst ( acspg(# a integer acspg(# ); CREATE acspg=# insert into tst v