select * from foo_table order by oid desc limit 1;
>From: Chris Ruprecht <[EMAIL PROTECTED]>
>To: "Leao Torre do Vale"
><[EMAIL PROTECTED]>,<[EMAIL PROTECTED]>
>CC: Jan Wieck <[EMAIL PROTECTED]>
>Subject: Re: [SQL] Last record
>Date: Wed, 24 Jul 2002 13:56:50 -0400
>
>Select * from where <..
hi,
Idon't know the best way but how about a quick insert in a temp table and
adding 1 to the inserted oid column each time the trigger will run.!
regards
Omid
>From: Markus Wagner <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED], [EMAIL PROTECTED],
>[EMAIL PROTECTED]
>Subject: [SQL] getting the oid
hi,
Grant all on sequence_name to theuser ;
regards
omid
>From: "Vladimir Terziev" <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: [SQL]
>Date: Wed, 29 Aug 2001 10:40:00 +0300
>
>Hi,
>
>I'm writing a script, which has to retrieve a next value from a sequnce. I
>use
>mod_perl, DBI and DBD::
Hi,
It is a not a clean job but how about having a view like this :
create view foo_view as select * from yourtable order by oid desc limit 2 ;
and then making your select like this:
select * from foo_view order by oid limit 1;
hope that helps
Omid
>From: Bhuvan A <[EMAIL PROTECTED]>
>To: [EMA
hi,
I had the same question a couple of days ago and I received some good helps.
look at the archives...
regards
Omid
>From: Bhuvan A <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: [SQL] is it possible to use arrays in plpgsql function??
>Date: Tue, 21 Aug 2001 11:24:08 +0530 (IST)
>
>
>hi
hi ,
Is there any split or explode function which split a whole string to
seperate parts using any special delimiter ?
TIA
Omid
_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
-
hi all,
Can some body show me how to declare a variable of type "array" in a
function using plpgsql ?
TIA
Omid Omoomi
_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
-
hi,
It depends on the variable type:
foo=> create function f1( int4) returns int4 as'
foo'> select $1 ;'
foo-> language 'sql';
CREATE
foo=> select f1(4);
f1
--
4
(1 row)
regards
Omid
>From: "Bill" <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: [SQL] Function define question
>Date: Sat, 18
select version();
>From: Roberto João Lopes Garcia <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: [SQL] How to get the server version??
>Date: Tue, 24 Jul 2001 10:50:50 -0300
>
>Hi
>
>Is there any way, possible an SQL or pgsql command, to get the server
>version?
>
>Thank you
>
>Roberto
>
position ( 'el' in 'hello') ;
>From: [EMAIL PROTECTED] (Karl Orbell)
>To: [EMAIL PROTECTED]
>Subject: [SQL] position(text,text) function
>Date: Mon, 23 Jul 2001 14:27:15 + (UTC)
>
>I'm having trouble using the position function, it's a simple built-in
>function.
>
>It returns the index of a
sum
- ---
ali 100
omid 200
shaya 50
then I get this:
fa1 sum
- ---
ali 350
omid 350
shaya 350
Any more idea ?
Omid Omoomi
>>The platform is PostgreSQL 6.5.2 on i386-unknown-freebsd3.2, compiled b
can I have my result with only one SQL statement ?
Thanks in advance
Omid Omoomi
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
but as a select command. Is this possible?
>
>
yes. try to run psql with -E and look at the related system tables when
running \d command like (pg_class, pg_user, ...)
regards
Omid Omoomi
_
Get Your Private, Free E-mail f
>From: Carolyn Lu Wong <[EMAIL PROTECTED]>
>To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
>Subject: [SQL] primary key question
>Date: Thu, 20 Jul 2000 17:26:30 +1000
>
>create table aaa(
> field1 not null,
> field2 ,
> ,
> primary key (field1, field2)
>);
>
Hi,
How about ordering by Address_type ? only needs to have 1, 2, 3 as
different address types in your desired order. like :
select person_id , address where address in not null order by address_type
limit 1 ;
sure you can change the limit if you wish more addresses.
hope that helps
Omid
Hi,
I'll be glad if you describe more details about the problem. Is it a kind of
statistical analysis or what?
Omid Omoomi
>From: "Kermani, Bahram" <[EMAIL PROTECTED]>
>To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
>Subject: [SQL] Median
$row = pg_fetch_array($exec, 1);
echo $row['col2'];
Regards
Omid Omoomi
>From: Bernie Huang <[EMAIL PROTECTED]>
>To: PGSQL-SQL <[EMAIL PROTECTED]>
>Subject: [SQL] Fetch an element in an array
>Date: Wed, 07 Jun 2000 17:21:52 -0700
>
>Hi,
>
>This i
If so then why do you need to use "select distinct " ?!
BTW, I just tested on my 6.5.2, This query :
"Select distinct f1 from table1 order by f2 "
works the same as this one:
"select distinct f1,f2 from table1"
>From: Jeff MacDonald <[EMAIL PROTECTED]>
>Reply-To: Jeff MacDonald <[EMAIL PROTECTED
would need to change the table structure to a better
normal form.
Regards ,
Omid Omoomi
>From: Jeff MacDonald <[EMAIL PROTECTED]>
>Reply-To: Jeff MacDonald <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED], [EMAIL PROTECTED]
>Subject: [SQL] 7.0 weirdness
>Date: Tue, 30 May 2000 0
19 matches
Mail list logo