Hi Jodi,
On Wednesday, November 5, 2003, at 12:16 AM, Jodi Kanter wrote:
Is there a straight forward way to pull out duplicates in a particular field given a value in another field?
For example, I have a table that lists users and study names associated with those users. Each user can have one or
On Wednesday, November 19, 2003, at 10:26 AM, Abdul Wahab Dahalan wrote:
How do I write a query so that I can get a result as below
[ select only a record/s with same kk and kj but different pngk.
For example here I've 3 records with same kk=01,kj=01 but diff
pngk=a,b,c
and 2 records with same kk
.4, but you can
add it if it's not.
Hope this helps.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
efulness of PostgreSQL without hindering SQL
conformance.
I'm interested in hearing what others have to say, especially along the
lines of implementation. I haven't seen much discussion of distributed
keys on the lists (other than Josh Berkus), so perhaps there isn't much
inte
earch
patterns), Applescript, FTP, CVS, and shell script support, if those
things interest you. I write most of my SQL in it before feeding the
file to psql or just copying and pasting the commands into phppgadmin
or psql directly.
Michael Glaesemann
grzm myrealbox com
---
otocols using (protocolid);
If you explain a little more what your query is trying to return, I
might be able to help more.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
e UNION, I believe. If it's
something else, I'm not sure I understand what you're asking. Perhaps
you could include a sample of what you're getting, along with what
you'd like to see?
Michael Glaesemann
grzm myrealbox com
---(end of broadcas
online docs:
<http://www.postgresql.org/docs/current/static/queries-order.html>
It doesn't explicitly give you an example of sorting on more than one
column, but the syntax explanation at the top includes it.
Does this help?
Michael Glaesemann
grzm myrealbox com
---
I usually use 'NULL' as NULL, so the line would be
foo bar NULL foofoo barbar
then use the COPY command with NULL AS 'NULL'
Check out the following link for detailed info on the COPY command:
<http://www.postgresql.org/docs/current/static/sql-copy.html>
HTH
Michae
quot;
Could you include the COPY command you're using, as well as the first
couple of lines of the file you're copying from? It's hard to know what
the problem is without this.
Regards,
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)
have some ideas on how to do this?
I'd suggest looking at tablefunc in /contrib. It includes crosstab
functionality that you might find useful. I don't think it'll do
exactly what you describe here, but something quite similar.
Michael Glaesemann
grzm myrealbox com
--
mp c;
ERROR: Bad date external representation ''
Here's your clue right here: It means the dodate text field in
custdo_temp contains data that does not represent a valid date. Check
to make sure custdo_temp.dodate is all properly formatted.
H
x27;m not wrong, a
view
does not accept any parameter as input...
But you can just define the view and select it with a WHERE clause with
your parameter, just like a normal table. Would that help?
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)--
SELECT DISTINCT vi1.vendor_id FROM vendors_items vi1
WHERE NOT EXISTS (
SELECT item_id FROM select_items
EXCEPT
SELECT items FROM vendors_items vi2
WHERE vi1.vendor_id = vi2.vendor_id
)
);
Michael Glaesemann
grzm myrealbox com
On Mar 9, 2004, at 10:37 PM, <[
IF foo IS NULL
THEN ...
ELSIF foo
THEN ...
ELSE ...
END IF;
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faqs/FAQ.html
On Jun 24, 2004, at 1:49 PM, sad wrote:
On Thursday 24 June 2004 09:32, Michael Glaesemann wrote:
Creating a new control structure to do handle this seems odd. However,
one could easily have the same effect using a nested if. Using the
pl/pgsql ELSIF construct, it's pretty straightforward.
I
lternative" for 3-valued logic afaik. Why should PostgreSQL go beyond
what the standard specifies in this hairy area? Three-valued logic is
something I strive to stay away from to the best of my ability, as it
is far too complicated for my feeble mind.
Michael Glaesemann
grz
ed to ensure there is a way to identify each row
uniquely. It is quite independent of which columns you may or may not
want to search on. If name is not going to be necessarily unique in the
table, it isn't a primary key.
Michael Glaesemann
grzm myrealbox com
On Jul 23, 2004, at 6:00 PM, Kenneth Gonsalves wrote:
On Friday 23 July 2004 03:29 pm, Michael Glaesemann wrote:
You appear to be misunderstanding the purpose of a primary key. A
primary key is used to ensure there is a way to identify each row
uniquely. It is quite independent of which columns
What you want is timestamp(2) or timestamptz(2), I believe.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
e a better choice if one is concerned with
compatibility.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faqs/FAQ.html
On Aug 3, 2004, at 8:50 PM, Achilleus Mantzios wrote:
O kyrios Michael Glaesemann egrapse stis Aug 3, 2004 :
I believe this is incorrect. I believe PostgreSQL uses its own
Do you suggest postgresql has any other means of getting
time except the time(2) syscall??
timestamp datatype internally
On Aug 4, 2004, at 12:13 AM, Tom Lane wrote:
Michael Glaesemann <[EMAIL PROTECTED]> writes:
No. I'm just saying that PostgreSQL does not represent or store
timestamps as epoch timestamps internally.
You're wrong.
It's not exactly Unix-like because we use a different epoch date
ation has turned my
negative "what it is not" knowledge into the much more positive "what
it is", and that's always a good thing.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
| c
---+---+---
1 | 2 | 3
1 | 1 | 1
(2 rows)
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
t;
test=# select true::text;
text
--
t
(1 row)
You can find more information at
<http://www.postgresql.org/docs/current/static/sql-createcast.html>
Hope this helps!
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
power operation for numeric, which I think you'd
have to write yourself, possibly leveraging one of the procedural
languages (perhaps pl/perl) to access such an operation (as you
yourself mentioned). I'm sure you could find an algorithm to port to
PL/pgsql as well.
Hope this help
On Aug 31, 2004, at 9:17 PM, Michael Glaesemann wrote:
What you need is a power operation for numeric, which I think you'd
have to write yourself,
Looking a little closer, there is a pow() function that takes two
numeric arguments and returns numeric.
<http://www.postgresql.org/docs
.
Luckily PostgreSQL provides convenient ways of making user-defined
casts.
Just my thoughts.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail c
pow(numeric,numeric) function? Would the 100 be cast INT -> NUMERIC?
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
you don't print *something* you can't see it?
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 8: explain analyze is your friend
On Sep 1, 2004, at 2:55 PM, sad wrote:
On Wednesday 01 September 2004 10:38, Michael Glaesemann wrote:
On Sep 1, 2004, at 2:41 PM, sad wrote:
On Wednesday 01 September 2004 09:24, Stephan Szabo wrote:
There's a fairly accepted convention for integer representations.
There's no such conv
00 to
NULL, for example. You may be able to do some of this preprocessing in
the database itself, first loading the raw data into a temporary table
and then transforming it before putting it into the desired table.
Michael Glaesemann
grzm myrealbox com
ch will be doing these inserts.
In that case I would recommend either using temp tables to process the
data, or build a middleware app that other client apps would connect
to, rather than to the db directly, the goal being to have a single API
against which you can code the client apps.
Good
On Sep 12, 2004, at 5:42 AM, [EMAIL PROTECTED] wrote:
Is the syntax "schema_name.index_name" for create unique index wrong,
unsupported or what? I know is doesn't work as postgres kicks me back
a syntax error each time (version 7.3.2 & 7.4.5). -sigh-
Could you give a full example (including the e
On Sep 12, 2004, at 2:48 PM, Michael Glaesemann wrote:
On Sep 12, 2004, at 5:42 AM, [EMAIL PROTECTED] wrote:
Is the syntax "schema_name.index_name" for create unique index wrong,
unsupported or what? I know is doesn't work as postgres kicks me back
a syntax error each time (versio
g 'build_interval'. Try
something like WHERE built_on < current_timestamp - build_interval *
INTERVAL '0.001 second';
(btw, current_timestamp is the SQL standard for now() )
Regards,
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)
On Nov 19, 2004, at 5:41 PM, Erik Thiele wrote:
now how do i know the id of my newly inserted element? and
how can this be done in a completely concurrency safe way?
This is a FAQ (4.15.1, among others). See currval() and nextval() in
the documentation as well.
Michael Glaesemann
grzm myrealbox
text
HINT: You will need to rewrite or cast the expression."
Both dates are of type timesamp!
Could you post the output to \d xyz and \d comments from psql?
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 6: Have
gth(constname) as constname_length
from a_constants_str;
Here's another one which would show if PostgreSQL is treating them
equally:
select constname, count(constname)
from a_constants_str;
The results of these queries might shed some light on the issue.
Hope this helps.
Michael Glae
marties" has a bunch of things like this in it.
I've found it quite helpful.
Hope this helps.
Michael Glaesemann
grzm myrealbox com
create table items (
item text not null
, qty integer not null
) without oids;
insert into items (item, qty) values ('foo', 1);
insert
esn't help you now, but it'll be there in the future.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings
aterial hard to get my head around myself :). Since I went through it,
I thought I'd share it with the list.
Regards,
Michael Glaesemann
grzm myrealbox com
test=# create table ts2int (ts2int_id serial not null unique
, ts timestamp without time zone default current_timestamp
, tstz
if e.timestamp is >= 1110241185 it's definitely going to
be <= 1112335200
Hope this helps. I find white space helps me read my own SQL much more
easily.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 3: if posting/read
On Mar 8, 2005, at 21:28, Larry Rosenman wrote:
On Tuesday 08 March 2005 06:21 am, Michael Glaesemann wrote:
Larry,
Restating your SQL in a more reader-friendly form:
[snip]
This is from an error page (and machine generated to boot :) )
Regardless if it's machine-generated or not, I
);
text2bool
---
t
(1 row)
test=# select text2bool('false');
text2bool
---
f
(1 row)
Just an idea.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
ype type_source on (castsource = type_source.oid)
join pg_type type_target on (casttarget = type_target.oid)
where type_target.typname = 'bool'
or type_source.typname = 'bool'
order by type_source.typname;
source | target
----+----
(0 rows)
This is in v8.0.3
Michael G
*/^#'. How do i do this?
With a RULE or a TRIGGER.
Or a CHECK constraint on the column.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 8: explain analyze is your friend
/docs/8.0/interactive/pltcl.html
Hope this helps.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings
.
Now how to change permission of that user to be able to create this
function?
Make sure the user creating the function is a PostgreSQL superuser.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 2: you can get off all lists a
superuser should be able to create such a function,
regardless of whether they created the database or not.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http
On Jun 10, 2005, at 7:26 PM, Michael Glaesemann wrote:
On Jun 10, 2005, at 6:51 PM, Dinesh Pandey wrote:
Actually this problem occurs when the function is being created by
the user who has not created the current database.
Solution: The database must be created by the user who is
issue with materialized views is
to make sure it's always up-to-date with the evaluation of the view.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
ql.org/docs/8.0/interactive/sql-createsequence.html
http://www.postgresql.org/docs/8.0/interactive/sql-altersequence.html
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
On Jul 5, 2005, at 6:40 PM, Dinesh Pandey wrote:
How can we create connection with Oracle database from Postgres
plpgsql function and execute some oracle stored procedure?
I don't think it's possible with plpgsql. Try DBI-link.
<http://pgfoundry.org/projects/dbi-link/>
Mi
this table as a
subquery. Any ideas?
Take a look at generate_series(), available in v8.0 and above.
http://www.postgresql.org/docs/8.0/interactive/functions-srf.html
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 9: In
s (by George Essig,
I believe):
Developing Time-Oriented Database Applications in SQL
by Richard T. Snodgrass
The book is out of print, but the author has made the PDF available
on his website at:
http://www.cs.arizona.edu/people/rts/tdbbook.pdf
Hope this helps!
Michael Glaesemann
grzm myre
AS num_of_users
FROM users
WHERE start_time BETWEEN startDate + 1 AND startDate + 2
And of course, using EXPLAIN ANALYZE will help decide which is more
performant.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
can understand your motivation, I personally think this kind
of operation is best left in the application layer (which includes
such insert functions) rather than the DDL.
Just my ¥2.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 6: explain analyze is your friend
ook in the archives will provide more info.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
On Sep 10, 2005, at 1:04 AM, Mark A. Strivens wrote:
select date_trunc('day',age(now(),dateofbirth)) from people
My questions is, is there any way to convert that figure into an age
expressed as a number days only?
Try
select current_date - dateofbirth from people;
Michael
lexibility. Changing a few SQL statements to return (or
insert) the columns how you want them is much easier than changing
the underlying table structure and having to make sure *all* of your
queries then fit the new table structure.
Michael Glaesemann
grzm myrealbox com
--
dencies, so it should be
relatively easy for people to install it if they want. (IIRC, there's
even been discussion in the past of whether or not PL/pgSQL should be
installed by default.)
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)--
duration
from cdr;
Then I'd select from this view using aggregates:
select callhour, avg(duration) as avg_duration
from cdr
where src = 601
group by callhour;
You could write it
This should help you with the simple case of just hourly averages.
For averages on any given
t sounds like it might be similar to either COALESCE or the IS NULL
expression.
These pages might help you:
COALESCE
http://www.postgresql.org/docs/8.0/interactive/functions-
conditional.html#AEN12056
IS NULL
http://www.postgresql.org/docs/8.0/interactive/functions-comparison.html
Hope this helps.
o/file.txt
For more psql goodness, take a look at:
http://www.postgresql.org/docs/8.0/interactive/app-psql.html
Hope this helps!
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings
and work on columns directly.
http://www.postgresql.org/docs/8.0/interactive/functions-aggregate.html
I suggest you take some time to look at the docs. They're quite
extensive and helpful.
http://www.postgresql.org/docs/8.0/interactive/index.html
Michael Glaesemann
grzm myrealbox com
I'm not quit
SQL as
'select true;';
CREATE FUNCTION
test=# select test_true();
test_true
---
t
(1 row)
If you want to install other procedural languages, perhaps the
documentation can help.
http://www.postgresql.org/docs/8.0/interactive/xplang.html#XPLANG-
INSTALL
Hope this helps
article?
http://www.eweek.com/article2/0,1895,1876702,00.asp
I skimmed it, but didn't see any mention of PostgreSQL. Perhaps I
missed it, or perhaps you mean another article?
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 4: H
ime zone - integer
How can drop a day to now()??
You can try a couple of different things: one is to use CURRENT_DATE
- 1 instead of now() -1. Another would be to cast now() to date,
e.g., now()::date - 1.
Hope this helps.
Michael Glaesemann
grzm myrealbox com
--
that may help you accomplish this:
OSCON 2004 presentation: Flexible Data Acquisition and Analysis
Joe's an active member of the PostgreSQL community and there's a lot
of good stuff there.
Hope this helps.
Michael Glaesemann
grzm myrealbox com
---(e
oided when possible, stating that
aggregations
and sub-queries should be used instead...
How would this be done in this scenario?
Something like:
select max(date), id
from observation
group by vector_id, obs_type;
Do test to see which is better in your situation.
Michael Glaesemann
grzm myr
-Original Message-
From: Michael Glaesemann [mailto:[EMAIL PROTECTED]
Sent: Saturday, 19 November 2005 12:28 p.m.
On Nov 19, 2005, at 7:49 , Jeremy Palmer wrote:
SELECT DISTINCT ON (vector_id, obs_type)
id
FROM observation
ORDER BY vector_id,
obs_type,
date
it is merely my
fantasy. ;-)
Will to_char() do what you want? Something like
test=# select to_char(current_date, 'Day -MM-DD');
to_char
--
Thursday 2005-12-08
(1 row)
http://www.postgresql.org/docs/current/interactive/functions-
formatting.html
er by some_date;
some_date | name1 | name2
+---+---
2006-01-01 | John | Jane
2006-01-03 | John | Sam
2006-01-05 | Jane | John
(3 rows)
Hope this helps.
Michael Glaesemann
grzm myrealbox com
-- DDL
create table table1 (
id1 integer not null
, id2 integer not null
a relational
construct.
You can always use EXPLAIN ANALYZE to compare query plans. It can be
very useful to see how your query is executed by the planner.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 4:
On Jan 14, 2006, at 0:45 , Michael Glaesemann wrote:
On Jan 14, 2006, at 0:22 , Adam Rosi-Kessel wrote:
id1 will always have a value but id2 can be NULL. So should I do a
left JOIN
on id2 but a plain JOIN on id1? Is there a disadvantage to using a
left JOIN
where it is not necessary
he command line, BUT have it default to a value inside
the SQL script if not present on the command line.
You could write a wrapper script that would accept a command line
argument and load the file with the appropriate SET statement prepended.
Michael Glaesemann
grzm myr
://www.postgresql.org/docs/current/interactive/sql-
syntax.html#SQL-SYNTAX-STRINGS
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
from "URIGHTS"
where "RIGHT" = 10
) as right_10 using ("ID")
Simple is in the eye of the beholder. You might want to compare the
EXPLAIN ANALYZE output to see if there are any significant
differences between these queries.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
n a table). As an aside, you need to double-quote
identifiers if you want them to be case-sensitive: otherwise they'll
be down-cased.
Hope this helps.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 6: explain analyze is your friend
more theoretical
information, "Temporal Data and the Relational Model" by CJ Date,
Hugh Darwen, and Nikos Lorentzos.[2]
Michael Glaesemann
grzm myrealbox com
[1](http://www.cs.arizona.edu/people/rts/tdbbook.pdf)
[2](http://www.amazon.com/gp/product/1558608559/)
---
clause
Find below the query plans for the variations we've seen (as well as
DDL statements):
Michael Glaesemann
grzm myrealbox com
create table urights
(
id integer not null
, uright integer not null
);
copy urights (id, uright) from stdin;
20 1
20 2
20 5
20
.038 rows=5 loops=1)
Filter: ((uright = 2) OR (uright = 5) OR (uright = 10))
Total runtime: 0.386 ms
(6 rows)
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an
NALYZE
or run some other benchmark to see if there's a performance
difference. Then you'll know for sure—and have numbers to back it up.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster
n name and argument types. You may
need to add explicit type casts.
If you double-quote your function name (or any identifier) when you
create it, you'll need to double-quote them when you call the
function as well. Try:
select * from "InventGroups_GetAllParents"(0::int8)
-> mysuperfield
MySuperField -> mysuperfield
mysuperfield -> mysuperfield
"MYSUPERFIELD" -> MYSUPERFIELD
"MySuperField" -> "MySuperField"
"mysuperfield" -> mysuperfield
Michael Glaesemann
grzm myrealbox com
---(en
;
ALTER TABLE fv_wystawione ALTER id_fv SET DEFAULT nextval
('id_fv_seq'::text);
ALTER TABLE fv_wystawione ALTER imie SET DEFAULT '';
commit;
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 6: explain analyze is your friend
://www.postgresql.org/docs/8.1/interactive/sql-select.html#SQL-LIMIT
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
ractive/sql-keywords-
appendix.html
I see FREEZE right between FREE and FROM. It's not an SQL keyword,
but it is used in PostgreSQL withe VACUUM command.
http://www.postgresql.org/docs/current/interactive/sql-vacuum.html
Hope this helps.
Michael Glaesemann
grzm myrealbox com
-
her than just CREATE
TRIGGER to apply the constraints you're looking for, as often you'll
need to wrap a multi-statement update in a transaction to ensure
integrity.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 3:
2 | 5 | f
3 | 5 | t
4 | 6 | f
5 | 6 | t
(5 rows)
insert into foo (id, active) values (5, true);
ERROR: duplicate key violates unique constraint "foo_partial_idx"
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)-
st t2 on (t1.a = t2.b and t1.b = t2.a)
where t1.a < t2.a;
t1_id | t2_id
---+---
4 | 7
1 | 2
(2 rows)
Hope this helps!
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 1: if posting/reading through Use
On Mar 11, 2006, at 16:46 , Michael Glaesemann wrote:
select t1.id as t1_id, t2.id as t2_id
from test t1
join test t2 on (t1.a = t2.b and t1.b = t2.a)
where t1.a < t2.a;
t1_id | t2_id
---+---
4 | 7
1 | 2
(2 rows)
Just a follow-up (mostly to myself): I'
p me one PostgreSQL Statement, Thanks
in Oracle
select rownum,groupid,qty from abc
--- ---
1 a5 3
2 a2 4
3 a3 5
4
5
.
.
.
in PostgreSql
How to wirte Statement ( Rownum -> change ??)
[EMAIL PROTECTED]
Michael Glaesemann
grzm myrealbox com
-
e generally recommended way is something like:
test=# select '4'::integer * interval '1 week';
?column?
--
28 days
(1 row)
or the more SQL compliant:
test=# select cast('4' as integer) * interval '1 week';
?column?
--
28 days
(
one
to obtain results in binary format. ...
Hope this helps.
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings
On Apr 7, 2006, at 16:28 , Daniel Browning wrote:
* Static Hierarchies and Binary Fractions in PostgreSQL, by Michael
Glaesemann
http://www.grzm.com/fornow/archives/2004/07/10/static_hierarchies
This is the most complete out-of-the-box solution I've found.
I wrote up Tropashko
something like:
SELECT *
FROM table
ORDER BY "ID", "Name";
Hope this helps.
Michael Glaesemann
grzm seespotcode net
---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
g., rows expected/actual
33110/94798). Does running ANALYZE help?
Michael Glaesemann
grzm seespotcode net
---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTE
1 - 100 of 184 matches
Mail list logo