On 8 Jul 2003, Markus Bertheau wrote:
> Hi,
>
> when you have
> select expensive_expression(column), * from table offset 20 limit 40
>
> can you somehow save the cost for the first 20 calculations of
> expensive_expression?
Might a functional or partial index work here?
On 8 Jul 2003, Markus Bertheau wrote:
> when you have
> select expensive_expression(column), * from table offset 20 limit 40
>
> can you somehow save the cost for the first 20 calculations of
> expensive_expression?
Right now the only way I can think of that might work is to push the
offset/limit
Hi,
when you have
select expensive_expression(column), * from table offset 20 limit 40
can you somehow save the cost for the first 20 calculations of
expensive_expression?
--
Markus Bertheau.
Berlin, Berlin.
Germany.
---(end of broadcast)---
TIP
I'm gonna guess you stored your ranking as a "text" field, but now you'd
like to treat it like an int / numeric.
While it would be better to go ahead and convert it, you can always cast
it:
select * from table order by textfield::int;
On Mon, 7 Jul 2003, Andreas Schmitz wrote:
>
> Hello *,
>
Andreas,
try
select sum_user,nextval('tipp_eval_seq')-1 as ranking from (
select user_sum from tbl_sums order by user_sum desc) as ss;
JLL
Andreas Schmitz wrote:
>
> Hello *,
>
> I have a little problem that confuses me. We are gathering values from a table
> as a sum to insert them into
> > but how are you searching through your table with sql, when your SELECT
> > is against a collection of different elements (e.g. Array of Strings,
> > which should fit on one column and return all records which fit)
>
> Are the 'a', 'b', etc... fixed or generated on the fly? I'm not sure
> th
On 7 Jul 2003, markus brosch wrote:
> I was searching the archive and was wondering why nobody asked this
> strange(!) question (or I've not found it?):
>
> "What is the max allowed length of a sql statement or query?"
AFAIR in recent versions it's effectively limited only by resources (how
much
On Mon, 2003-07-07 at 18:13, [EMAIL PROTECTED] wrote:
> Well i DO NOT know the exact limit.
> May be someone else can answer it accurately.
>
> But you could produce the list within IN using a subselect
> that again depends on the exact problem.
>
Maybe anybody knows how many?
Anyway: My exact
> Could be a solution?!
> The question is - how long could the IN be?
I'm not sure about IN specifically, but I know you can do:
SELECT * FROM table WHERE col = '<1GB long file>';
It tends not to be friendly for Ram though :)
signature.asc
Description: This is a digitally signed message part
> On Mon, 2003-07-07 at 17:57, [EMAIL PROTECTED] wrote:
>> Depending on ur original problem EXISTS or IN may be usable
>> EXISTS is efficient and IN can be used efficiently in 7.4 version of
>> postgresql
>
> Could be a solution?!
> The question is - how long could the IN be?
>
> I mean, if I write
On Mon, 2003-07-07 at 17:57, [EMAIL PROTECTED] wrote:
> Depending on ur original problem EXISTS or IN may be usable
> EXISTS is efficient and IN can be used efficiently in 7.4 version
> of postgresql
Could be a solution?!
The question is - how long could the IN be?
I mean, if I write something l
Suppose I have a relation called sales with the following schema:
sales-Schema = (cust, prod, mn, dy, yr, quant, st)
An instance of the relation would look something like this:
custprodmn dy yr quant st
== == == = ==
Knuth Milk02
Depending on ur original problem EXISTS or IN may be usable
EXISTS is efficient and IN can be used efficiently in 7.4 version
of postgresql
regds
mallah.
> Hi All!
>
> I was searching the archive and was wondering why nobody asked this
> strange(!) question (or I've not found it?):
>
> "What
Hi All!
I was searching the archive and was wondering why nobody asked this
strange(!) question (or I've not found it?):
"What is the max allowed length of a sql statement or query?"
I want to combine hundrets or thousands 'OR' within a select statement.
Possible or not (e.g: SELECT * FROM table
On Monday 07 Jul 2003 4:10 pm, Gary Stainburn wrote:
> On Monday 07 Jul 2003 3:34 pm, Richard Huxton wrote:
> > Don't do "select *" do "select field_a,field_b..." - the * doesn't just
> > refer to the locos table.
>
> Sorry if I didn't make myself plain enough, but I had
>
> create view loco_dets a
Richard Rowell wrote:
Can I accomplish this with postgresql without involving an external
process (like say perl)? I guess I could put the upgrade stuff into
PL/SQL functions and just drop the functions when I'm done, but I was
hoping for something a little "cleaner".
There is no way (currently at
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
> > times (as lid, lnid and lnaid). Ho
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
> times (as lid, lnid and lnaid). How can I remove lnid and lnaid from the
> result?
>
> create
Hello *,
I have a little problem that confuses me. We are gathering values from a table
as a sum to insert them into another table. I also need to get a ranking at
insert (i.e. Highest points will get first place and so on). I tried ton
invole a sequence to qualify the ranking by select at ins
Moving to Postgres from MS SQL server wherever I can. When writing
database upgrade scripts, it is nice to construct the script so it will
run correctly even if run twice. In MS-SQL's TSQL I would do something
like this:
IF( SELECT COUNT(*) FROM sysobjects WHERE name = 'foo' AND type ='U' ) <
1
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) ln on ln.lnid = l.lid and
> >
> > ^^^
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
>
> ^^^ ^^^
>
> > ERROR: No such attribute or f
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
^^^ ^^^
> ERROR: No such attribute or function ln.lnid
Is is this?
--
Richard Huxton
-
On Mon, 7 Jul 2003, Gary Stainburn wrote:
> Hi folks,
>
> I know I'm missing something blindingly obvious, can someone point it out to
> me please.
>
> create table locos ( -- Locos table - contains details of locos
> lid int4 default nextval('loco_lid_seq'::text) unique not
Hi folks,
I know I'm missing something blindingly obvious, can someone point it out to
me please.
create table locos (-- Locos table - contains details of locos
lid int4 default nextval('loco_lid_seq'::text) unique not null,
lclass int4 references lclass(lcid),
Not quite sure what the question is
Assuming, you would like to normalize the data, I suggest to create 4
tables:
create table gpa (id integer primary key,gpa varchar(32) not null unique);
create table major (id integer primary key,major varchar(32) not null
unique);
create table birthplace (
Hai..
How to merge record in database(sql statement) if record same attribute, examples:-
Attribute Major Birth_Place GPA
Record 1science India excellent
Record 2science India excellent
Please help me..
_
27 matches
Mail list logo