2013/5/18 Brian Sherwood :
> I am running postgresql 9.2.
>
> I am assuming it would be a function of psql to right justify text, but I
> can't find any way to do this.
>
> Is there a way to right justify just one text column?
If you mean have the psql client right-justify a particular text column
the column type info can be found in information_schema.column view.
jov
在 2013-5-17 下午11:27,"Brian Sherwood" 写道:
> I am running postgresql 9.2.
>
> I am assuming it would be a function of psql to right justify text, but I
> can't find any way to do this.
>
> Is there a way to right justify just
Thanks for the pointer.
It got me half way.
This is the solution:
select distinct id, unnest ( string_to_array ( trim ( array_column, ';'
), ';' ) ) from import;
Am 18.03.2013 20:24, schrieb Venky Kandaswamy:
You can try
select id, unnest(array_col) from table
__
You can try
select id, unnest(array_col) from table
Venky Kandaswamy
Principal Engineer, Adchemy Inc.
925-200-7124
From: pgsql-sql-ow...@postgresql.org [pgsql-sql-ow...@postgresql.org] on behalf
of Andrea
Quoth maps...@gmx.net (Andreas):
> Am 17.02.2013 19:20, schrieb Andreas Kretschmer:
> > Andreas hat am 17. Februar 2013 um 18:02 geschrieben:
> >> I need to store data that has a valid timespan with start and enddate.
> >>
> >> objects ( id, name, ... )
> >> object_data ( object_id referencs objec
Am 17.02.2013 19:20, schrieb Andreas Kretschmer:
Andreas hat am 17. Februar 2013 um 18:02 geschrieben:
I need to store data that has a valid timespan with start and enddate.
objects ( id, name, ... )
object_data ( object_id referencs objects(id), startdate, enddate, ... )
nothing special, yet
Andreas hat am 17. Februar 2013 um 18:02 geschrieben:
> Hi,
>
> I need to store data that has a valid timespan with start and enddate.
>
> objects ( id, name, ... )
> object_data ( object_id referencs objects(id), startdate, enddate, ... )
>
> nothing special, yet
>
> How can I have PG reject a
2013/1/31 Nei Rauni Santos :
> Thank you Pavel,
>
> I could do that like this:
>
>
> select p.id,
>
> ( select array_accum ((
> room_name, room_id, room_group_name, room_group_id, room_order,
> availability_min, price_amount, price_min, price_avg, price_balcony_amount,
> price_balcony_avg, capacity
Thank you Pavel,
I could do that like this:
select p.id,
( select array_accum ((
room_name, room_id, room_group_name, room_group_id, room_order,
availability_min, price_amount, price_min, price_avg, price_balcony_amount,
price_balcony_avg, capacity, deposit_required, breakfast_included,
room_mi
Hello
select (fce(..)).column from ...
or select column from fce()
Regards
Pavel Stehule
2013/1/31 Nei Rauni Santos :
> Hi,
>
> The problem is, I'm working in a list of hotels which should have
> availability of rooms and list the hotel and its rooms on the application.
>
> I have this functio
Andreas writes:
> SELECT some_fct( some_id ) FROM some_other_table;
> How can I split this up to look like a normal table or view with the
> column names that are defined in the RETURNS TABLE ( ... ) expression of
> the function.
The easy way is
SELECT (some_fct(some_id)).* FROM some_o
On 01/08/2013 01:53 PM, Emi Lu wrote:
Hello,
May I know how to generate drop table cascade when pg_dump a schema please?
E.g.,
pg_dump -h db_server -E UTF8 -n schema_name -U schema_owner --clean
-d db_name >! ~/a.dmp
In a.dmp, I'd like to get:
drop table t1 cascade;
drop table t2 cascade;
From: saikiran mothe [mailto:saikiran.mo...@gmail.com]
Sent: Saturday, November 10, 2012 10:14 PM
To: pgsql-sql@postgresql.org
Subject: How to compare two tables in PostgreSQL
Hi,
How can i compare two tables in PostgreSQL.
Thanks,
Sai
Here is simple sql to show data in table1, but not in ta
ad of
> creating files and compare them. (got that from Joe Celko ;) )
>
>
>
> --
> Date: Mon, 12 Nov 2012 11:00:32 +0300
> Subject: Re: [SQL] How to compare two tables in PostgreSQL
> From: kamaual...@gmail.com
> To: pgsql-sql@postgresql.o
Hi,
On Sun, 2012-11-11 at 08:43 +0530, saikiran mothe wrote:
> How can i compare two tables in PostgreSQL.
http://pgfoundry.org/projects/pg-comparator/
Open source, under active development.
Regards,
--
Devrim GÜNDÜZ
Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
Postg
According to Dr Google, this tool may suit your needs:
http://www.sqlmanager.net/en/products/postgresql/datacomparer?gclid=CImMsbmLybMCFQRc3godNgQAdQ
For business use only $133.
Date: Mon, 12 Nov 2012 11:00:32 +0300
Subject: Re: [SQL] How to compare two tables in PostgreSQL
From
I would try to stick to SQL solutions as much as possible, instead of creating
files and compare them. (got that from Joe Celko ;) )
Date: Mon, 12 Nov 2012 11:00:32 +0300
Subject: Re: [SQL] How to compare two tables in PostgreSQL
From: kamaual...@gmail.com
To: pgsql-sql@postgresql.org
If you would like to compare their contents perhaps this may help.
Write a select statement containing the fields for which you would like to
compare data for, you may want to leave out fields whose values are
provided by default for example fields populated from sequence object
and/or timestamp fi
On 11/10/2012 08:13 PM, saikiran mothe wrote:
Hi,
How can i compare two tables in PostgreSQL.
Thanks,
Sai
Compare their content or their definition?
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sq
> -Original Message-
> From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-
> ow...@postgresql.org] On Behalf Of air
> Sent: Saturday, October 06, 2012 8:48 AM
> To: pgsql-sql@postgresql.org
> Subject: [SQL] How to make this CTE also print rows with 0 as count?
>
> I have a CTE based qu
On 2012-09-23, Abhijit Prusty -X (abprusty - UST Global at Cisco)
wrote:
> --_000_8A2A33BFAA5E2F408D0BBB80844412720487D0xmbalnx03ciscocom_
> Content-Type: text/plain; charset="us-ascii"
> Content-Transfer-Encoding: quoted-printable
>
> Hi,
>
> I have a query in oracle like this mentioned below
>
On Wed, Jun 27, 2012 at 7:26 PM, David Johnston wrote:
> On Jun 27, 2012, at 21:07, Andreas wrote:
>
>
> You should look and see whether the hstore contrib module will meet your
> needs.
>
> http://www.postgresql.org/docs/9.1/interactive/hstore.html
>
>
hstore is certainly an option, as are the
On Jun 27, 2012, at 21:07, Andreas wrote:
> Hi
>
> I do keep a table of objects ... let's say companies.
>
> I need to collect flags that express yes / no / don't know.
>
> TRUE / FALSE / NULL would do.
>
>
> Solution 1:
> I have a boolean column for every flag within the companies-table.
2012/6/24 Craig Ringer :
> As far as I know PostgreSQL does not currently offer native facilities for
> row-level access control (except possibly via SEPostgreSQL
> http://wiki.postgresql.org/wiki/SEPostgreSQL_Introduction).
Yes. Row-level access was in SEPostgreSQL's drafts but after many discuss
On 06/22/2012 07:36 PM, Andreas wrote:
Hi,
is there a way to limit access for some users only to certain records?
e.g. there is a customer table and there are account-managers.
Could I limit account-manager #1 so that he only can access customers
only acording to a flag?
What you describe is
Andreas writes:
> Hi,
>
> is there a way to limit access for some users only to certain records?
>
> e.g. there is a customer table and there are account-managers.
> Could I limit account-manager #1 so that he only can access customers
> only acording to a flag?
Maybe something like the followin
HI,
>
> is there a way to limit access for some users only to certain records?
>
> e.g. there is a customer table and there are account-managers.
> Could I limit account-manager #1 so that he only can access customers
> only acording to a flag?
>
> Say I create a relation cu_am ( customer_id,
no,I think there is no such way.
what about create view for the user you want to limit,and revoke select
privilege from the base table ?
2012/6/22 Andreas
> Hi,
>
> is there a way to limit access for some users only to certain records?
>
> e.g. there is a customer table and there are account-ma
Andreas wrote:
> Hi,
>
> is there a way to limit access for some users only to certain records?
>
> e.g. there is a customer table and there are account-managers.
> Could I limit account-manager #1 so that he only can access customers
> only acording to a flag?
Yea, it's possible.
Write funct
On 06/13/2012 08:46 AM, John Fabiani wrote:
I have tried to use a user defined data type I created within a schema.
But I could not figure it out.
CREATE OR REPLACE FUNCTION xchromasun._chromasun_totals(date)
RETURNS SETOF xchromasun.weekly_mpr AS
CREATE OR REPLACE FUNCTION xchromasun._chrom
Hi Sergey
Thats exacly what i was looking for, thanks a million !
Best regards
Jan Eskilsson
2012/6/5 Sergey Konoplev :
> On Mon, Jun 4, 2012 at 4:08 PM, Jan Eskilsson wrote:
>> My problem is that i would like to be able to retrieve a group of
>> records from the hstore table and present them
On Mon, Jun 4, 2012 at 4:08 PM, Jan Eskilsson wrote:
> My problem is that i would like to be able to retrieve a group of
> records from the hstore table and present them in a grid so I would
> like to convert the hstore records back to the original table format.
> In the manual i found an example
Hi-
With respect similarity, its a costly operation on CPU based on the cycles
of checking the keyword.
Two words are said to be similar when atleast 2 or more consecutive
characters are at the same. The more the consecutive characters are the
same the more level of similarity.
It would look sim
On 2012-04-10, JORGE MALDONADO wrote:
> --000e0ce0d2ee43edb104bd553408
> Content-Type: text/plain; charset=ISO-8859-1
>
> I have a table with a varchar field, such a field is HTML ENCODED. So, for
> example, the string "PLAIN WHITE T'S" is saved as "PLAIN WHITE
> T''S" (double quotes are not part
Hello
see
http://postgres.cz/wiki/PostgreSQL_SQL_Tricks#Function_for_decoding_of_url_code
Regards
Pavel Stehule
2012/4/10 JORGE MALDONADO :
> I have a table with a varchar field, such a field is HTML ENCODED. So, for
> example, the string "PLAIN WHITE T'S" is saved as "PLAIN WHITE T''S"
> (dou
Hello
use a refcursors
http://www.postgresql.org/docs/9.1/static/plpgsql-cursors.html
Regards
Pavel Stehule
2012/4/4 La Chi :
> hi every one
>
> i have created this simple function which returns a column of table , i have
> used simple SELECT statement , i simply want to know how can i achieve
, March 26, 2012 9:08 PM
*Subject:* Re: [SQL] how to concatenate in PostgreSQL
On 03/24/2012 04:43 AM, Rehan Saleem wrote:
hi ,
how can we concatinate these lines and execute sql command
In what? Psql? A PL/pgSQL function. C/Java/PHP/Python/Perl/Erlang/Lua?
setsql = 'select user,use
On 03/24/2012 04:43 AM, Rehan Saleem wrote:
hi ,
how can we concatinate these lines and execute sql command
In what? Psql? A PL/pgSQL function. C/Java/PHP/Python/Perl/Erlang/Lua?
setsql = 'select user,username, firstname '
set sql += ' lastname, cardno from table1 where userid=' +
Hi,
Probably you're looking for these set of articles.
http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL#Microsoft_SQL_Server
The second article (by Ethan) has good small hints for things such as
the query that you ask in this thread, when migrating from MSSQL to
P
On 3/24/12, Andreas Kretschmer wrote:
> Rehan Saleem wrote:
>
>> hi ,
>> how can we concatinate these lines and execute sql command
>>
>>set sql = 'select user,username, firstname '
>> set sql += ' lastname, cardno from table1 where userid=' + 5
>
> sql = sql || ' bla fasel';
>
> ||
Rehan Saleem wrote:
> hi ,
> how can we concatinate these lines and execute sql command
>
>set sql = 'select user,username, firstname '
> set sql += ' lastname, cardno from table1 where userid=' + 5
sql = sql || ' bla fasel';
|| is the concat - Operator.
Andreas
--
Really, I
On Fri, Mar 2, 2012 at 3:49 AM, Philip Couling wrote:
> Hi Rehan
>
> I suggest attempting to drop the table before you create the temp table:
> DROP TABLE IF EXISTS table1;
>
> See:
> http://www.postgresql.org/docs/current/static/sql-droptable.html
>
>
> Also if you're using an actual TEMP table,
2012/2/29 Pavel Stehule :
> Hello
>
> the most similar tool in pg is "VACUUM FULL" statemet;
Hello,
From: http://wiki.postgresql.org/wiki/VACUUM_FULL "Many people, either
based on misguided advice on the 'net or on the assumption that it
must be "better", periodically run VACUUM FULL on their tab
Hi Rehan
I suggest attempting to drop the table before you create the temp table:
DROP TABLE IF EXISTS table1;
See:
http://www.postgresql.org/docs/current/static/sql-droptable.html
Also if you're using an actual TEMP table, PostgreSQL can automatically
drop the table or just empty it once the t
Hello
the most similar tool in pg is "VACUUM FULL" statemet;
Regards
Pavel Stehule
2012/2/29 Rehan Saleem :
> hi ,
> how can i shrink database in postgresql here is a MS-SQL store procedure
> which shrinks the database. how same task can be achieved in postgresql.
>
> ALTER PROCEDURE [dbo].[sp_
Tirsdag 28. februar 2012 12.56.46 skrev Rehan Saleem :
> hi ,
> whats wrong with this function , i am getting syntax error which is syntax
> error at or near "+=" LINE 13: set sql += ' bpoverlap, centredistance
You can't concatenate that way in plpgsql. Instead of "set sql +=" try with
just "||
ce<>'')
set sql += ' and (centredistance<=' + centre_distance + ' or ' +
centre_distance + '=1) '
set sql += ' order by chr_u, start_u'
exec(sql)
end;
$BODY$
language plpgsql;
Fr
;
$BODY$
language plpgsql;
From: Filip Rembiałkowski
To: Rehan Saleem
Cc: "pgsql-sql@postgresql.org"
Sent: Tuesday, February 28, 2012 3:36 PM
Subject: Re: [SQL] How to convert SQL store procedure to Postgresql function
On Tue, Feb 28, 2012 at
On Tue, Feb 28, 2012 at 9:50 AM, Rehan Saleem wrote:
> hi ,
> how can i convert this sql store procedure to postgresql function , i shall
> be very thankful to you, as i am new to postgresql and i dont know how to
> handle this kind of store procedure in postgresql
Most people handle this with u
On 2012-02-20, Andreas wrote:
> Hi,
> is there a way to split up phone numbers?
several. I wouldn't trust a computer to do any of them.
> I know that's a tricky topic and it depends on the national phone number
> format.
> I'm especially interested in a solution for Germany, Swizerland and Aust
(anonymous) wrote:
> is there a way to split up phone numbers?
> I know that's a tricky topic and it depends on the national
> phone number format.
> I'm especially interested in a solution for Germany, Swizerland and Austria.
> I've got everything in a phone number column that makes hardly sense
At 2012-02-20 15:50, Andreas wrote:
Hi,
is there a way to split up phone numbers?
I know that's a tricky topic and it depends on the national phone
number format.
I'm especially interested in a solution for Germany, Swizerland and
Austria.
I've got everything in a phone number column that mak
On 01/22/2012 06:09 AM, Rehan Saleem wrote:
hi , i have created this function
CREATE OR REPLACE FUNCTION totaloverlapcount(user_id integer , bg
integer ,center_distance integer)
RETURNS varchar AS $$
DECLARE percentage record;
BEGIN
select fname, lname, count(userid) totalcount
,100.00*co
Hello
2012/1/22 Rehan Saleem :
> hi , i have created this function
>
> CREATE OR REPLACE FUNCTION totaloverlapcount(user_id integer , bg integer
> ,center_distance integer)
> RETURNS varchar AS $$
>
> DECLARE percentage record;
> BEGIN
>
>
>
> select fname, lname, count(userid) totalcount
> ,100.0
On Thu, Jan 19, 2012 at 1:57 AM, Rehan Saleem wrote:
> hi ,
>
> how can i return the whole user table from this function not just the id .
> thanks
>
> Chapter 39, specifically 39.3, of the postgresql documentation provides
all of the information necessary to answer this question. If, after
rea
-
From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] On
Behalf Of Olgierd Michalak
Sent: Monday, November 07, 2011 1:25 PM
To: Craig Ringer
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] How to implement Aggregate Awareness?
> Simply put, when Transparent (to the re
> Simply put, when Transparent (to the reporting tool) Aggregate Navigator
> recognizes that a query would execute faster using aggregates, it
> automatically rewrites the query so that the database hits the smaller
> aggregates rather than larger detail tables upon which the small
> aggregates are
On 11/05/2011 05:03 AM, Olgierd Michalak wrote:
Simply put, when Transparent (to the reporting tool) Aggregate Navigator
recognizes that a query would execute faster using aggregates, it
automatically rewrites the query so that the database hits the smaller
aggregates rather than larger detail t
On Oct 25, 2011, at 7:12 AM, alan wrote:
> I'm new to postgres and was wondering how to use EXPLAIN ANALYZE
>
> Can I use the output from ANALYZE EXPLAIN to estimate or predict the
> actual time
> it would take for a given query to return?
>
> I ask because I'm writing a typical web app tha
On 19/10/11 22:08, Rich wrote:
> I have a mumps database with an ODBC connection so I can write queries
> from other databases. How can I write a sql in Postgresql to access
> this table to use in my Postgresql reports?
Use dbi-link to make an ODBC connection to the other database. Either
copy th
On 10/21/2011 09:36 PM, Emi Lu wrote:
Good morning,
Is there a way to temporally disabled foreign key constraints something
like
SET FOREIGN_KEY_CHECKS=0
When population is done, will set FOREIGN_KEY_CHECKS=1
If you really, really want to do this you can do it by disabling the
triggers tha
Emi Lu wrote on 21.10.2011 15:36:
Good morning,
Is there a way to temporally disabled foreign key constraints something like
SET FOREIGN_KEY_CHECKS=0
When population is done, will set FOREIGN_KEY_CHECKS=1
Thanks a lot!
Emi
You can define the FKs as "DEFERRABLE INITIALLY IMMEDIATE".
Then a
Not really, sorry :(
What I am looking for is no DB structure changes.
But only disabling foreign key constraint check/verify for period of
time and then recover it.
Similar to mysql's "set FOREIGN_KEY_CHECKS = true/false"
Emi
On 10/21/2011 10:58 AM, Oliveiros d'Azevedo Cristina wrote:
S
Something like
ALTER TABLE t_yourtable DROP CONSTRAINT
and then
ALTER TABLE t_yourtable ADD FOREIGN KEY
?
Best,
Oliveiros
- Original Message -
From: "Emi Lu"
To:
Sent: Friday, October 21, 2011 2:36 PM
Subject: [SQL] how to temporally disable foreign key constraint check
Good m
I have references to dblink. I just installed 9.1.1.1 on windows server
2008 R2 and did a search on the file dblink.sql and cannot find it. I used
the one click installer from enterprisedb.
1. Where is the dblink.sql file or does it not exist anymore and the
integration into postgresql has chan
Hi.
If you have 9.1, then exist foreign wrapper odbc_fdw, you may try it.
2011/10/19, Rich :
>>
>> I have a mumps database with an ODBC connection so I can write queries
>> from
>> this database. How can I write a sql in Postgresql to access this
>> database
>> to use in my Postgresql reports?
>
On Wed, Oct 19, 2011 at 9:19 AM, Rich wrote:
>> I have a mumps database with an ODBC connection so I can write queries
>> from this database. How can I write a sql in Postgresql to access this
>> database to use in my Postgresql reports?
dblink lets one pg server access another via SQL, dbilink
On 09/26/2011 06:31 PM, Andreas wrote:
How could I calculate differences of timestamps in a log-table?
Table log ( user_id integer, login boolean, ts timestamp )
So login = true would be a login-event and login = false a logout.
Is there a way to find the matching login/logout to calculate the
(anonymous) wrote:
> How could I calculate differences of timestamps in a log-table?
> Table log ( user_id integer, login boolean, ts timestamp )
> So login = true would be a login-event and login = false a logout.
> Is there a way to find the matching login/logout to
> calculate the difference?
Am 01.07.2011 04:17, schrieb Tim Landscheidt:
besides the regexp_replace() solution mentioned by Charlie
and Steve, you can also use TRANSLATE():
| tim=# SELECT TRANSLATE('a{b''c"d!f', '{}()''",;.:!', '');
nice, 2 solutions for 1 problem. :)
my replace...replace... was a wee bit tedious ;)
(anonymous) wrote:
> how can I remove a set of characters in text-columns ?
> Say I'd like to remove { } ( ) ' " , ; . : !
> Of course I can chain replace ( replace ( replace ( replace
> ( ... , '' ) and replace the chars one by one against
> an empty string ''.
> There might be a more elega
Would
regexp_replace(src_str, '[\{\}\[\]\(\)\.', '')
at
http://www.postgresql.org/docs/9.0/static/functions-string.html
help?
- Reply message -
From: "Andreas"
Date: Thu, Jun 30, 2011 4:28 pm
Subject: [SQL] How to remove a set of characters in text-columns ?
To:
Hi,
how can I re
On 06/30/2011 12:28 PM, Andreas wrote:
Hi,
how can I remove a set of characters in text-columns ?
Say I'd like to remove { } ( ) ' " , ; . : !
Of course I can chain replace ( replace ( replace ( replace ( ... , ''
) and replace the chars one by one against an empty string ''.
There might
Emi Lu wrote:
> Thank you for the info.
>
> I found a simple way:
> ==
> [1] create SEQUENCE tmp start 7820;
> [2]
> insert into desti_table_name
> select nextval('tmp'),
>c1, c2... ... cN
> from t1 left join t2... ... tn
> where ... ...
>
> Jus
Thank you for the info.
I found a simple way:
==
[1] create SEQUENCE tmp start 7820;
[2]
insert into desti_table_name
select nextval('tmp'),
c1, c2... ... cN
from t1 left join t2... ... tn
where ... ...
Just for people using 8.3, this is mimic r
If your table is not terribly big, you can
try something like
SELECT a.col1,a.col2, COUNT(*) as row_number
FROM yourTable a,yourTable b
WHERE a.col1 >= b.col1 -- I'm assuming col1 is primary key
GROUP BY a.col1,a.col2
ORDER BY row_number
This is pure SQL, should work in every version...
Bes
On Apr 20, 2011, at 9:15 PM, Emi Lu wrote:
> ROW_NUMBER() is only ready in 8.4. For 8.3, is there a simple way to get
> row_number
> select row_number(), col1, col2...
> FROM tableName
Following is a link of deepsz which has a way of implementation of rownum.
http://www.depesz.com/index.php/
you can also generate a crosstab table using the sign function
you can check out the link below ( its a sqlite tutorial, but the same
idea will work for pg too )
http://souptonuts.sourceforge.net/readme_sqlite_tutorial.html
On 03/09/2011 12:16 PM, Eric Ndengang wrote:
Hi Guys,
I have the fo
Hey Eric,
2011/3/9 Eric Ndengang
> Hi Guys,
> I have the following table:
>
> Name Value rang salary
>
> name1 value1 12500
> name2 value2 22600
> name3 value 3 3300
>
> and want to obtain the following result:
>
> name1 name2 name3
On Wed, Feb 2, 2011 at 12:40 PM, creationw
wrote:
>
> Hello,
>
> I have a sample table describe as follows, anyone knows how to checking the
> existence of a constraint?
>
> oviddb=# \d myTable
>
> Column | Type | Modifiers
> -+--+---
> orderid | smallint | not null
use function which searches through this tables:
-pg_constraint
-pg_trigger
On Wed, Feb 2, 2011 at 11:21 PM, creationw
wrote:
>
> Hello,
>
>
> I found that DROP CONSTRAINT [ IF EXISTS ] is available in Postgres 9.1
> http://developer.postgresql.org/pgdocs/postgres/sql-altertable.html
> http://de
Ok, before 8.4, there I can use row_number().
For 8.3 + display tag + order by integer + paging based on pageBean
ArrayList alist;
In Bean.java, added:
private int rec_num;
in main .action java:
for(int i=0 ; i
Piotr Czekalski, 27.01.2011 16:21:
Gentelmen,
I follow this thread and I don't
Piotr Czekalski, 27.01.2011 16:21:
Gentelmen,
I follow this thread and I don't exactly get an idea of yours, but
isn't is as simple as (example: table "web.files" contains one column
named "fileurl" ):
select row_number() over(), X.fileurl from (select fileurl from
web.files order by fileurl) X
Gentelmen,
I follow this thread and I don't exactly get an idea of yours, but isn't
is as simple as (example: table "web.files" contains one column named
"fileurl" ):
select row_number() over(), X.fileurl from (select fileurl from
web.files order by fileurl) X
The only disadvantage is that
Hi Oliveiros,
Howdy!
If it is to order in ascendent fashion by, say, lname,
one possibility would be
SELECT COUNT(b.*) as row_number, a.lname,a.gname
FROM "Table1" a, "Table2" b
WHERE a.lname >= b.lname
GROUP BY a.lname,a.gname
ORDER BY row_number
If you want to order by gname just chang
Hi Oliveiros,
If it is to order in ascendent fashion by, say, lname,
one possibility would be
SELECT COUNT(b.*) as row_number, a.lname,a.gname
FROM "Table1" a, "Table2" b
WHERE a.lname >= b.lname
GROUP BY a.lname,a.gname
ORDER BY row_number
If you want to order by gname just change the WHERE c
If it is to order in ascendent fashion by, say, lname,
one possibility would be
SELECT COUNT(b.*) as row_number, a.lname,a.gname
FROM "Table1" a, "Table2" b
WHERE a.lname >= b.lname
GROUP BY a.lname,a.gname
ORDER BY row_number
If you want to order by gname just change the WHERE clause according
Hi, Lu Ying.
How do you define which row is #1 ? And #2 ?
E.g. Ordered by lname? Or gname...?
Best,
Oliveiros
- Original Message -
From: "Emi Lu"
To:
Sent: Wednesday, January 26, 2011 4:11 PM
Subject: [SQL] how to get row number in select query
Good morning,
For postgresql 8.3
On Wed, Dec 15, 2010 at 11:23 AM, venkat wrote:
> Dear All,
>
> How do i convert string to int
>
> select SUM(pan_1) from customers1 where name='101'
>
> When i run the above query i m getting "function sum(character varying)
> does not exist"..
>
> Please anyone can guide me..
>
> Thanks
>
>
Hello
you can use a ::int for converting to integer. Or better - you can
alter column to integer. It will be faster and more correct.
Regards
Pavel Stehule
2010/12/15 venkat :
> Dear All,
> How do i convert string to int
> select SUM(pan_1) from customers1 where name='101'
> When i run the ab
ohhh,, sorry... It was wrong post..sorry again...
On Fri, Oct 29, 2010 at 10:30 AM, Shoaib Mir wrote:
> On Fri, Oct 29, 2010 at 3:48 PM, venkat wrote:
>
>> Dear All,
>>
>> I want to convert integer datatype to serial datatype.. is that
>> possible.Please let me know.
>>
>>
> I don't think ALT
On Fri, Oct 29, 2010 at 3:58 PM, venkat wrote:
> Dear All,
>
> I got the solution... Here is my query
>
> ALTER TABLE DemoTable ALTER gid TYPE INT2;
>
>
>
Are you sure that you have converted here to a SERIAL type?
--
Shoaib Mir
http://shoaibmir.wordpress.com/
On Fri, Oct 29, 2010 at 3:48 PM, venkat wrote:
> Dear All,
>
> I want to convert integer datatype to serial datatype.. is that
> possible.Please let me know.
>
>
I don't think ALTER TABLE will let you do that... so the best way to achieve
the same is:
- Create a sequence for the column (set th
Dear All,
I got the solution... Here is my query
ALTER TABLE DemoTable ALTER gid TYPE INT2;
Thanks again
On Fri, Oct 29, 2010 at 10:18 AM, venkat wrote:
> Dear All,
>
> I want to convert integer datatype to serial datatype.. is that
> possible.Please let me know.
>
> Thanks and Rega
In article <4cc4d3e2.7090...@gmx.net>,
Andreas writes:
> Hi,
> I'm wondering if there was a clever way to find parts of a numeric
> string in another table.
> There is a table that holds city-codes and city-names. City-code would
> be the part of a phone number that identifies the city.
> Over he
Andreas wrote on 16.10.2010 05:23:
Hi,
how can I collect text-fields from multiple rows into one output row?
I'd like to do an equivalent to the aggregate function SUM() only for text.
The input is a select that shows among other things a numerical column where I
would like to group by.
The te
Dear Lee,
Perfect Its working fine Thanks alot..
Thanks and Regards,
Venkat
On Fri, Jul 30, 2010 at 1:43 AM, Lee Hachadoorian <
lee.hachadoor...@gmail.com> wrote:
> All geometric columns in all spatially enabled tables appear in the table
> public.geometry_columns, defined as:
>
> CRE
All geometric columns in all spatially enabled tables appear in the
table public.geometry_columns, defined as:
CREATE TABLE public.geometry_columns
(
f_table_catalog character varying(256) NOT NULL,
f_table_schema character varying(256) NOT NULL,
f_table_name character varying(256) NOT N
Wes James, 28.07.2010 19:35:
I'm trying to do this:
select * from table where field::text ilike '%\_%';
but it doesn't work.
How do you escape the _ and $ chars?
The docs say to use \, but that isn't working.
( http://www.postgresql.org/docs/8.3/static/functions-matching.html )
The text bet
Hey James,
Because in future releases the default value of the
"standard_conforming_strings"
parameter will change to "on" for improved standards compliance.
You should use string constants with C-Style escapes.
Please, see
http://www.postgresql.org/docs/8.4/static/sql-syntax-lexical.html#SQL-SYNT
1 - 100 of 896 matches
Mail list logo