I have two tables, with a many to one relationship.
Table InfrequentTable
- timestamp ts
- int infrequentId (newly added key)
Table FrequentTable(Many FrequentTable entries per one
InfrequentTable entry)
- timestamp ts
- int infrequentId (newly added column)
The
Hello newsgroup!
I'm trying to build up a menu by sending ONE query to database.
Afterwards the result is used by PEAR::HTML_Menu get
a html-structered menu.
db-structure of gallery:
++---+--+--++---+
| id | title | date | root | parent | level |
++---+--+-
Marcus Claesson wrote:
Hi Richard,
Just looking at the start of your output, you are missing some rows
(a/1/1) and have replaced others (a/2/1 isn't in your data).
Yes, that's exactly it. There's no mistake. The only column I need to
update is 'full', by giving every row a new 'full', based on i
Here is a example of a trigger function
CREATE OR REPLACE FUNCTION public.ipinfo_trg()
RETURNS trigger AS
'DECLARE
dhcpvarchar:=\'DHCP\';
rtype varchar:=\'RAS\';
BEGIN
if NEW.ipaddress != dhcp then
if OLD.ipaddress != dhcp then
if OLD.atype != rtype then
On Dec 17, 2004, at 1:23 AM, Richard Sydney-Smith wrote:
I expect this has been done MANY times and I wonder if a general
purpose trigger exists or if not then can someone point me to an
example set of triggers?
I'm not aware of a "general purpose" trigger for this. If you just want
some extra
On Fri, Dec 17, 2004 at 18:22:48 +0530,
Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> On Friday 17 December 2004 06:12 pm, D'Arcy J.M. Cain wrote:
>
> > An alternative to Andreas' suggestion would be to create a simple lookup
> > table and join them. This is good if the real life example can g
On Fri, Dec 17, 2004 at 16:55:45 +0530,
Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> hi
>
> table:
>
> name varchar(10)
> fruit integer
>
> i want to write an sql statement like this:
>
> select fruit from table
>
> which should return 'good' if fruit = 1 and 'bad' if fruit =2 and 'rotten'
Hi Richard,
> Just looking at the start of your output, you are missing some rows
> (a/1/1) and have replaced others (a/2/1 isn't in your data).
Yes, that's exactly it. There's no mistake. The only column I need to
update is 'full', by giving every row a new 'full', based on its
'score'. The tri
O Kenneth Gonsalves έγραψε στις Dec 17, 2004 :
> On Friday 17 December 2004 05:54 pm, Andreas Kretschmer wrote:
>
> > Yes, simple:
> >
> > test=# select name, case
> > test-# when fruit = 1 then 'good'
> > test-# when fruit = 2 then 'bad'
> > test-# when fruit = 3 then 'rotten' end as fruit from
On Friday 17 December 2004 05:54 pm, Andreas Kretschmer wrote:
> Yes, simple:
>
> test=# select name, case
> test-# when fruit = 1 then 'good'
> test-# when fruit = 2 then 'bad'
> test-# when fruit = 3 then 'rotten' end as fruit from fruit;
can one do the same thing for an 'insert' statement?
k
On Friday 17 December 2004 06:12 pm, D'Arcy J.M. Cain wrote:
> An alternative to Andreas' suggestion would be to create a simple lookup
> table and join them. This is good if the real life example can get
> larger and/or the list can change and you don't want to modify code
> every time it does.
On Fri, 17 Dec 2004 16:55:45 +0530
Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> i want to write an sql statement like this:
>
> select fruit from table
>
> which should return 'good' if fruit = 1 and 'bad' if fruit =2 and
> 'rotten' if fruit =3
An alternative to Andreas' suggestion would be to
Marcus Claesson wrote:
Hi!
I have a problem with getting the order I want on a table after new rows
have been inserted. I try to simplify it...:
In other words, I have this old table:
SELECT * from table ORDER BY full,part;
namefullpartscore
--- --- -
a 1
am 17.12.2004, um 17:48:15 +0530 mailte Kenneth Gonsalves folgendes:
>
> thanks - opened up a whole new world for me. One more thing, the values come
> under the column 'case', can i avoid having the column 'case' and get the
> 'good', 'bad' and 'rotten' under the column 'fruit'?
Yes, simple:
On Friday 17 December 2004 05:15 pm, Andreas Kretschmer wrote:
> test=# select * from fruit;
> name | fruit
> +---
> Apple | 1
> Banana | 2
> Cherry | 3
> (3 Zeilen)
>
>
> test=# select name, fruit, case
> test-# when fruit = 1 then 'good'
> test-# when fruit = 2 th
am 17.12.2004, um 16:55:45 +0530 mailte Kenneth Gonsalves folgendes:
> hi
>
> table:
>
> name varchar(10)
> fruit integer
>
> i want to write an sql statement like this:
>
> select fruit from table
>
> which should return 'good' if fruit = 1 and 'bad' if fruit =2 and 'rotten' if
> fruit =3
>
hi
table:
name varchar(10)
fruit integer
i want to write an sql statement like this:
select fruit from table
which should return 'good' if fruit = 1 and 'bad' if fruit =2 and 'rotten' if
fruit =3
can it be done?
kg
---(end of broadcast)---
TI
Hi!
I have a problem with getting the order I want on a table after new rows
have been inserted. I try to simplify it...:
I want to have a one-to-one relationship between 'name' and 'full'.
Every 'name' (or'full') have one or more 'parts'. The higher the 'score'
the lower the 'full', but for my p
18 matches
Mail list logo