Hi all,
here in England OFTEL, the governing body for all things telephone
recent hand another phone number dialing code change (one of many).
This means that e.g. all mobile numbers that used to start 0589 now
start 07889.
Is there a way in SQL to update the phone number in-place?
--
Gary
|| results.mnumber;
else
return results.tnumber || ''-'' || results.mnumber;
end if;
END;
' LANGUAGE 'plpgsql';
__END__
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested governmen
ion ''Member '' || unitno || '' not found'';
return 0;
end if;
return results.mid;
END;
' LANGUAGE 'plpgsql';
__END__
Gary
On Wednesday 18 July 2001 3:10 pm, Gary Stainburn wrote:
> Hi all, I've just written my first pl/pgsq
27;Member % Not Found'', unitno;
>
> > -Original Message-
> > From: Gary Stainburn [SMTP:[EMAIL PROTECTED]]
> > Sent: Wednesday, July 18, 2001 10:24 AM
> > To: pgsql-sql
> > Subject:Re: pl/pgsql - code review + question
> >
> > Okay, I
' so that it included
the three phone numbers if they exist?
The only solution I can think of is to write a plpgsql function to do the
lookup and call that three times as part of the select, something like
select *, getphone(mphone) as phone, getphone(mfax) as fax.
but a p
hone(m.mmobile) as mobile,
getunitno(m.mid) as munitno
from members m,
address a,
teams t,
emails e
where m.madd = a.aid and
m.memail = e.eid and
m.mteam = t.tid;
--
Gary Stainburn
This email does not contain private or confidential material a
;) || '-' ||
to_char(m.mnumber,'00') as unitno from teams t, members m
where m.mteam = t.tid;"
unitno
-
SW/ 041- 03
SW/ 041- 05
NE/ 011- 06
NE/ 011- 01
NE/ 011- 03
NE/ 011- 02
NE/ 011- 10
--
Gary Stainburn
This email does not contain private or
Hi all,
forget it, I've solved it. I converted the calls to:
to_char(t.tnumber,'FM000')
and it worked.
Gary
On Monday 23 July 2001 10:18 am, Gary Stainburn wrote:
> Hi all,
>
> Can someone please explain how to remove the spaces from the results of the
> query be
aight forward so far, a member must be a part of a team and a team
must be in a region. My problem is that I want to set rliasson as a
reference to members (mid) as the Regional Liasson Officer for each region is
a member.
--
Gary Stainburn
This email does not contain private or confidential ma
e how to set
up the reference after creating the tables (it uses create triggers), and
then changing/adding these lines to my create script.
Your way seems much nicer.
Gary
On Monday 23 July 2001 3:18 pm, Jan Wieck wrote:
> Gary Stainburn wrote:
> > Hi all, me again.
> >
>
ERROR: parser: parse error at or near "union"
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000
sday 02 August 2001 4:50 pm, Bruce Momjian wrote:
> Does anyone have a fix for this?
>
> > From: "Gary Stainburn" <[EMAIL PROTECTED]>
> >
> > > psql -c "select t.tregion || '/' || to_char(t.tnumber,'000') || '-'
plains like "ERROR: Relation
> 'customers' does not exist"
> when creating 'shops'.
>
> Someone told me I should create a third table, ok, but in this case I loose
> the total
> control about my logic... Do you have a suggestion ?
>
> Thanks a
n get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed p
r,''FM000'')
from teams
where tid = $1;
if not found then
raise exception ''Team % not found'',$1;
return '''';
end if;
return unitno;
END;
' LANGUAGE 'plpgsql';
--
Gary Stainburn
ion ?
> >> >
> >> > Thanks a lot in advance !
> >> >
> >> > Denis
> >> >
> >> >
> >> > ---(end of
> >>
> >> broadcast)---
> >>
> >>
adings ( -- daily reading per pump/nozzle
prdate date not null,
prpump int4 not null
prnozzle int4,
propen integer,
prclose integer,
primary key (prdate, prpump, prseq)
);
I only want the insert to work if prpid matches pgpid and prnozzle matches
pgnozzle.
--
Gary Stainburn
Th
key
lktype indicates the link type - 'R' indicates a route entry
lklid indicates the link ID. For a 'R' it is the rtid of the route entry
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government partie
,
(select r2.rtid as rid, count(lnk.lkid) as cnt from route r2,links lnk
where lnk.lktype='R'
and lnk.lklid = r2.rtid group by r2.rtid) as subsel
where r.rtid = subsel.rid;
[gary@larry gary]$ psql -d nymr On Fri, 29 Nov 2002, Gary Stainburn wrote:
> > Hi folks.
> >
> &
, r.rtname, subsel.cnt from route r,
(select r2.rtid as rid, count(lnk.lkid) as cnt from route r2, links lnk
where lnk.lktype='R' and lnk.lklid = r2.rtid group by r2.rtid) as subsel
left outer join subsel on r.rtid = subsel.rid;
which comes back with the error:
[gary@larry gary]$ ps
hat it returns:
select * from myview;
sid | Name| OPS | MPD
-+-+-+-
1 | Rod | | 3
2 | Jayne | 2 | 5
3 | Freddie | 3 |
and if I add another row to depts, that the new row would be included?
--
Gary Stainburn
This email does not contain private or c
a plpgsql function to dynamically create the view
> you're looking for.
How could a plpgsql dynamically create the view?
How about a trigger from the on-update of the depts table to drop the view and
then create a new one. Could it not do the same thing using outer joins.
(I've done VE
table to work on
> -- aggregate_func ALIAS FOR $5; -- the name of the aggregate function
> -- aggr_columnALIAS FOR $6; -- the aggregate column (entries to be
> aggregated)
>
> First try:
> SELECT create_pivot_report
> ('sales_report2','vendor','pr
ranks_record.did || ''.rdid = '' || quote_literal(ranks_record.did)
> ;
> END LOOP;
> create_view :=
> create_view || join_text || '';'';
> EXECUTE create_view ;
>
> RETURN 0;
> END;
> ' LANGUAGE 'plpgsql' ;
>
> should w
On Tuesday 17 Dec 2002 2:31 pm, Tomasz Myrta wrote:
> Gary Stainburn wrote:
> > I found that the compile error complaining about the 'OR' was on the
> >
> > CREATE OR REPLACE FUNCTION
> >
> > line. I removed the 'OR REPLACE' and everything wo
; from stdin;
1 M 3 Charge Cleaner
2 O 3 Lock Carriages
\.
(I want the first row to work and the second to be rejected)
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unk
Hi Tomasz,
On Wednesday 18 December 2002 4:46 pm, Tomasz Myrta wrote:
> Hello again
>
> Gary Stainburn wrote:
> > Hi folks,
> >
> > how do I define a referene from 2 columns in 1 table to 2 columns in
> > another.
> >
> > I have:
> >
> >
On Wednesday 18 December 2002 4:56 pm, Gary Stainburn wrote:
> Hi Tomasz,
[snip]
> > > create table jobtypes (
> > > jid int4 default nextval('jobs_jid_seq'::text) unique not null,
> > > jdid character references ranks(rdid),
Thanks for that Tom
On Wednesday 18 Dec 2002 5:50 pm, Tom Lane wrote:
> Gary Stainburn <[EMAIL PROTECTED]> writes:
> > I've just tried this on a 7.2.1-5 system and get the same error.
> >
> >> create table jobtypes (
> >> jidint4 default n
On Thursday 19 Dec 2002 9:58 am, Tomasz Myrta wrote:
> Gary Stainburn wrote:
> > That did the trick. However, I now have another problem with the
> > constraint
> > complaining about there not being an index to refer to. However,
> > there is.
> > Output
On Thursday 19 Dec 2002 11:30 am, Tomasz Myrta wrote:
> Gary Stainburn wrote:
> > On Thursday 19 Dec 2002 9:58 am, Tomasz Myrta wrote:
> > >Gary Stainburn wrote:
> > >>That did the trick. However, I now have another problem with the
> > >>constraint
On Thursday 19 Dec 2002 3:17 pm, Tom Lane wrote:
> Gary Stainburn <[EMAIL PROTECTED]> writes:
> > That did the trick. However, I now have another problem with the
> > constraint complaining about there not being an index to refer to.
> > However, there is.
&g
2 | 0 | 1 | 2
(1 row)
nymr=#
What I want to be able to do is select multiple rows and have the correct
tally appear for that row.
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for
On Friday 20 Dec 2002 10:51 am, Philip Warner wrote:
> At 10:21 AM 20/12/2002 +0000, Gary Stainburn wrote:
> >nymr=# select r.*, s.tally from roster r,
> >nymr-# (select count(*) as tally from roster_staff where
> >nymr(# rsdate = '2002-01-01' and rsgid =
ount
---
21
(1 row)
nymr=# select count(*) from jobtypes;
count
---
7
(1 row)
nymr=# select count(*) from abilities;
count
---
0
(1 row)
nymr=# insert into abilities values (1, 'F', 1);
INSERT 404593 1
nymr=# select count(*) from abilities;
count
---
On Saturday 28 December 2002 3:48 pm, Stephan Szabo wrote:
> On Sat, 28 Dec 2002, Gary Stainburn wrote:
> > When I create the database, I use the COPY command. The ranks and
> > jobtypes are populated okay but the abilities table is empty. However,
> > if I then INSERT the
as rmiles
from turns t
left outer join staff d on t.tfitter = d.sid
left outer join staff f on t.tccleaner = f.sid
where r.rtid = t.tid
order by tdate;
ERROR: Relation 'r' does not exist
--
Gary Stainburn
This email does not contain priva
On Monday 06 January 2003 6:31 pm, Stephan Szabo wrote:
> On Mon, 6 Jan 2003, Gary Stainburn wrote:
> > create view turn_details as
> > select t.*, d.sid as dsid, d.sname as dname,
> > f.sid as fsid, f.sname as fname,
> > (select sum(r.rmiles) a
; ---(end of broadcast)-------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
--
Gary Stainburn
This email does
tab delimited
> file could be:
>
> #!/usr/bin/env python
>
> import csv
> import sys
>
> def convert(file):
> try:
> f = open(file, 'r')
> lines = f.readlines()
> p = csv.parser()
> for line in lines:
> prin
On Friday 07 Feb 2003 1:26 pm, Tomasz Myrta wrote:
> Gary Stainburn wrote:
> > On Friday 07 Feb 2003 10:48 am, Tomasz Myrta wrote:
>
>
>
> > Hi Tomasz,
> >
[snip]
>
> I understood your problem well and I just thought some idea will be enough
> to continue wo
yseq;
select nextval('myseq'), name from tblcontact;
drop sequence myseq;
There may well be a way to do it without the sequence, bit I can't think of
one.
Gary
>
>
>
> -----
> Do you Yahoo!?
> Yahoo! Shopping - Send Flowers fo
omail command to [EMAIL PROTECTED] so that your
> message can get through to the mailing list cleanly
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulat
ly exist on the roster while many will
exist on both.
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000
On Friday 07 Feb 2003 10:48 am, Tomasz Myrta wrote:
> Gary Stainburn wrote:
> > Hi folks,
> >
> > I've got two tables, first a history table containing tallies for
> > staff/jobs prior to going live, and second a roster table showing date,
> > diagram, job
On Friday 07 Feb 2003 12:09 pm, Gary Stainburn wrote:
> On Friday 07 Feb 2003 10:48 am, Tomasz Myrta wrote:
> > Gary Stainburn wrote:
> > > Hi folks,
> > >
> > > I've got two tables, first a history table containing tallies for
> > > staff/j
es ('1000');
>
> As single query.
>
> But better use COPY command or prepared statment.
>
> Inserts slow commonly due to indexis and foreing keys.
If you use a 'prepared' insert within a transaction, would that speed things
up - maybe by defering index update
uot;
Attribute | Type | Modifier
---+---+-
glid | integer | not null default
nextval('glossary_glid_seq'::text)
glterm| character varying(30) | not null
gldesc| text |
Indice
rom company) c on c.coid = lc.lcompany;
ERROR: No such attribute or function ln.lnid
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2
On Monday 07 Jul 2003 1:07 pm, Richard Huxton wrote:
> On Monday 07 Jul 2003 12:40 pm, Gary Stainburn wrote:
> > left outer join
> > (select lnumber from lnumbers) ln on ln.lnid = l.lid and
>
> ^^^ ^^^
>
> >
On Monday 07 Jul 2003 1:36 pm, you wrote:
> On Monday 07 Jul 2003 1:07 pm, Richard Huxton wrote:
> > On Monday 07 Jul 2003 12:40 pm, Gary Stainburn wrote:
> > > left outer join
> > > (select lnumber from lnumbers
On Monday 07 Jul 2003 3:34 pm, Richard Huxton wrote:
> On Monday 07 Jul 2003 2:12 pm, Gary Stainburn wrote:
> > I've managed to get the view I wanted by using sub-selects - as shown
> > below, but I now have the 'lid' field showing in the resulting view three
>
t
9 | 75014 | t
10 | 75029 | t
22 | 76079 | t
4 | 80135 | t
20 | 825 | t
18 | 901 | t
5 | 926 | f
26 | D3723 | f
15 | D5061 | t
12 | D7628 | t
25 | D9009 | t
24 | D9019 | f
(38 rows)
nymr=#
--
Gary Stainburn
This email does not con
On Wednesday 16 July 2003 3:27 pm, Dmitry Tkach wrote:
> Gary Stainburn wrote:
> >Hi folks,
> >
> >I've got a table holding loco numbers and an id which references the locos
> >table. How can I sort this table, so that numeric values appear first in
> >nume
re set to false.
I'm guessing that I need to create a trigger to be actioned after an insert or
update which would update set lncurrent=false where lnid not =
but I can't seem to sus it put.
--
Gary Stainburn
This email does not contain private or confidential material as it
may be
On Thursday 17 Jul 2003 3:34 pm, Dmitry Tkach wrote:
> Gary Stainburn wrote:
> >Hi folks,
> >
> >I'm back with my lnumbers table again.
> >
> >nymr=# \d lnumbers
> > Table "lnumbers&q
On Monday 11 August 2003 11:24 am, Gary Stainburn wrote:
> Hi folks,
>
> I don;t know if it's cos it's Monday or what, but I can't see what's wrong
> here.
>
> I've got two tables, turns which holds a turn number, a task, and where
> appropriate a li
d > 0 then
-#concat(r.rcid::text || ' on ' || l.lnumber::text)
-# else
-#r.rcid::text
-# end as task
-# from rides r
-# left outer join loco_dets l on r.rlid = l.lid
-# group by rtid
-# order by rtid
-# ;
ERROR: Attribute r.rlid must be
can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undis
llow
field.
How can I update nallowfollow from the appropriate vallowfollow flag?
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of
On Wednesday 29 Oct 2003 2:58 pm, Stephan Szabo wrote:
> On Wed, 29 Oct 2003, Gary Stainburn wrote:
> > Hi folks,
> >
> > don't know if it's cos of the 17 hours I've just worked (sympathy vote
> > please) but I can't get this one worked out
> &g
from statement group by account) as s
bank-# on s.account = a.key;
I get
ERROR: No such attribute or function 'key'
Any ideas why?
Also, I'm sure I can do this more efficiently as a single select/join, but
can't seem to work out why (Friday morning syndrome). Anyone give m
've tried renaming the field to regcount in case it was a reserved word
problem).
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulati
Hi folks.
I've got a last_updated field on my stock records of type timestamp.
This last_updated field I get using the perl code:
my $timestamp=(stat "$localcsv/VehicleStock.$data_suffix")[10];
How can I insert the integer timestamp in $timestamp into my table?
--
Gary Stainbu
On Tuesday 16 March 2004 5:56 pm, Frank Finner wrote:
> On Tue, 16 Mar 2004 16:54:18 +0000 Gary Stainburn
> <[EMAIL PROTECTED]> sat down, thought
>
> long and then wrote:
> > Hi folks.
> >
> > I've got a last_updated field on my stock records of type tim
create view balances as
select cost_cs_id, cost_cl_id, cost_css_id, count(*) as qty
from cons_stock
group by cost_cs_id, cost_cl_id, cost_css_id;
I then have trouble joining this to the consumables and locations table to get
the results I need.
--
Gary Stainburn
This email does not contai
id, cost_cl_id) values
(1, 2, 1);
create view balances as
select cost_cs_id, cost_cl_id, cost_css_id, count(*) as qty
from cons_stock
group by cost_cs_id, cost_cl_id, cost_css_id;
>
>
> Regards,
>
> Stijn Vanroye
>
> -
On Monday 19 April 2004 4:01 pm, Gary Stainburn wrote:
> On Monday 19 April 2004 3:06 pm, Stijn Vanroye wrote:
> > Gary wrote:
> > > Hi folks,
> > >
> > > here's a straight forward join that I simply can't get my head round.
> > >
>
hardware=#
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000
---(end of
On Wednesday 12 May 2004 11:02 am, Gary Stainburn wrote:
> Hi folks.
>
[snip]
> create view order_summary as
> select
> c.cs_id, cs.count as qty, c.cs_make, c.cs_code, c.cs_type,
> cst.cst_desc, c.cs_colour,
> o.or_id,
> o.or_supp, o.or_date
sts"
psql:goole1.sql:45: ERROR: JOIN/ON clause refers to "requests", which is not
part of JOIN
[EMAIL PROTECTED] gary]$
which at least makes sense.
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government
On Monday 21 Jun 2004 3:19 pm, Tom Lane wrote:
> Gary Stainburn <[EMAIL PROTECTED]> writes:
> > from requests r, users u, request_types t,
> > request_states s, dealerships d, departments de, customers c
> > left outer join (select co_r_id, c
On Monday 21 Jun 2004 4:11 pm, Gary Stainburn wrote:
> On Monday 21 Jun 2004 3:19 pm, Tom Lane wrote:
> > Gary Stainburn <[EMAIL PROTECTED]> writes:
> > > from requests r, users u, request_types t,
> > > request_states s, dealershi
#
What I want is something like
update requests set r_fuel=, r_c_id = 7 where r_c_id in (...
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regu
t * from stock_available where branch != 'Doncaster'
and
select * from stock_available where branch != 'Leeds'
which only return the equivelent of the top two (we only have Leeds and
Doncaster) are les than 1 second.
Anyone got any ideas of the cause, or thoughts on how I can tr
On Thursday 28 October 2004 11:16 am, Gary Stainburn wrote:
> Hi folks.
>
> I have the following view:
>
> CREATE VIEW "stock_available" as
> SELECT * FROM stock_details
> WHERE available = true AND visible = true AND
> location not in (SELECT descr FROM ign
On Thursday 28 October 2004 3:25 pm, Tom Lane wrote:
> Gary Stainburn <[EMAIL PROTECTED]> writes:
> > Anyone got any ideas of the cause, or thoughts on how I can trace
> > the problem?
>
> EXPLAIN ANALYZE results for the fast and slow cases would be
> interesting
iddleton should
return 1, 2004-01-01 09:12:12 and Root should return 4, 2004-11-10
12:12:00
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Inves
On Tuesday 16 November 2004 1:08 pm, sad wrote:
> On Tuesday 16 November 2004 14:29, Gary Stainburn wrote:
> > Hi folks.
> >
> > I'm looking at the possibility of implementing a photo gallery for
> > my web site with a tree structure
> >
> > How wou
of owner
pp_part -- id of owned
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000
---
rected version of a suggestion
by Sean Davis
update pieces set p_owner=piece_pieces.pp_id from piece_pieces where
piece_pieces.pp_part=pieces.p_id;
Under Sean's suggestion I did this inside a transaction block so I could
check that it did what I wanted.
--
Gary Stainburn
This email does not
bumped to the top of the list, but instead appear in their correct
position in the order by value part.
Is it possible and if so how do I do it?
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
On Wednesday 09 March 2005 1:06 pm, you wrote:
> Gary Stainburn wrote:
> > Hi folks.
> >
> > I seem to remember somewhere being shown how to bump specific rows
> > to the top of a list; something along the lines of:
> >
> > select c_id as key, c_des as val
27;m not after someone to do my work for me, but a good starting point
would be very much appreciated)
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regula
get a syntax error. Anyone see why?
hardware=# update pieces set p_owner = (case if p_owner = 305 then 724
else 305 end) where p_owner in (305, 724);
ERROR: parser: parse error at or near "p_owner"
hardware=#
--
Gary Stainburn
This email does not contain private or confi
p_site = \'L\' where p_id = $1;
>
> update pieces set p_name = \'SPARE\', p_location = \'spare\',
> p_site = \'L\'
> where p_id = 2;
>
This isn't quite what I want. I want to SWAP the p_name and p_location
between the two record
#x27; THEN 'A' ELSE owner END) WHERE owner IN ('A','B')
>
> Hello again.
>
> I've tried the first one but get a syntax error. Anyone see why?
>
> hardware=# update pieces set p_owner = (case if p_owner = 305 then
> 724 else 305 end) where p_
s d on r.r_d_id = d.d_id,
left outer join departments de on r.r_de_id = de.de_id,
left outer join customers c on r.r_c_id = c.c_id,
left outer join comment_tallies co on r.r_id = co.r_id
ORDER BY r.r_id;
psql:new-view.sql:19: ERROR: parser: parse error at or near "left"
--
Gary Stainburn
Th
On Friday 01 April 2005 1:01 pm, you wrote:
> On Friday 01 Apr 2005 5:06 pm, Gary Stainburn wrote:
> > Hi folks.
> >
> > I've been looking at this for 10 minutes and can't see what's
> > wrong. Anyone care to enlighten me.
>
> comma after '
in plates pl on r.r_plates = pl.pl_id
ORDER BY r.r_id;
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000
for the help anyway.
Gary
On Friday 01 Apr 2005 1:46 pm, you wrote:
> Can you send the EXPLAIN ANALYZE of each? We can't really tell where
> the slowdown is without that.
>
> On Apr 1, 2005 12:32 PM, Gary Stainburn
<[EMAIL PROTECTED]> wrote:
> > Hi folks.
> >
>
, one for the start date/time and one for
the return date/time.
How do I go about creating constraints on inserts and updates to ensure
that
a) the finish is after the start
b) two allocations for a single vehicle don't overlap.
--
Gary Stainburn
This email does not contain priva
Hi folks
I've got a table holding item code(cs_id), supplier a/c (co_id) , and
price (cs_price).
How can I select the rows containing the lowest price for each item
code?
I've tried various forms of min() etc and know it must be simple but I'm
stumped.
Gary
--
Gary Stainbu
On Wednesday 26 October 2005 4:21 pm, Gary Stainburn wrote:
> Hi folks
>
> I've got a table holding item code(cs_id), supplier a/c (co_id) , and
> price (cs_price).
>
> How can I select the rows containing the lowest price for each item
> code?
>
> I've tried v
270
2591 | YF06OJM | NL | NL6351
2627 | YC06SGX | ND | ND9057
1795 | YC06SGX | ND | ND9057
2634 | YB06KHT | NL | NL6450
2620 | YF06ZKD | ND | ND9236
(21 rows)
--
Gary Stainburn
This email does not contain private or confi
On Friday 07 July 2006 11:29, Gary Stainburn wrote:
> I know this is probably a FAQ but Google etc hasn't helped.
>
> I have two tables, both with stock number and registration number in.
> The second table always has the correct stock number, the first doesn't.
>
> I
x27;) as BASE_NAME,
substring('150mm LD AD Asp XR Macro','^\\d+mm (.*)$') as SUFFIX;
base_name | suffix
---+
150mm | LD AD Asp XR Macro
(1 row)
The brackets surround the required match
--
Gary Stainburn
This email does not con
4 |3
2009-07-09 | 5 |4
2009-07-08 | 12 |2
2009-07-07 | 5 |4
2009-07-06 | 2 |7
2009-07-03 | 2 |6
2009-07-02 | 7 |5
2009-07-01 | 19 |3
2009-06-30 | 20 |3
--
Gary Stainburn
This emai
y.o_date , orders, delivery
> FROM (/* ur first query here */) ordersQuery
> NATURAL RIGHT JOIN (/* ur second query goes here */) deliveryQuery
> ORDER BY deliveryQuery.o_date DESC
>
> Tararabite,
>
> Oliveiros
> @Allgarve
>
>
>
> 2009/7/13 Gary Stainburn
>
?
Cheers
--
Gary Stainburn
Gary's Haircut 700
Please visit http://www.justgiving.com/Gary-Stainburn/ to help me
raise money for Cancer Research - in return I'll have my head shaved
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscrip
1 - 100 of 169 matches
Mail list logo