WHERE table_id = 973
ORDER BY record_date
) t;
DROP SEQUENCE rownum;
Any ideas ?
(Of what I remember, I think till recently PostgreSql internally replaced
'MAX(x)' queries with a 'ORDER BY x DESC LIMIT 1' implicitly)
--
Robins
any
user given query.
Regards,
Robins Tharakan
On 5/7/07, Stefan Becker <[EMAIL PROTECTED]> wrote:
I might be told off by some better SQL-User here on the list -
still here is my 2 Cents worth
> I needed ROW_NUMBER() in PostGresql and I did find the 'temporary
sequence&
pe in case the return parameters are changing and that your select
statement is a simple SELECT * from fn().
Personally, I have tried both and believe the second way (TYPE) is quite
convenient for me.
Regards,
Robins Tharakan
On 5/11/07, Gábriel Ákos <[EMAIL PROTECTED]> wrote:
Hi,
How s
Unless I overlooked something here, does this work ?
SELECT no, name, MAX(similarity(name, 'Tooneyvara')) AS sim
FROM vtown
WHERE similarity(name, 'Tooneyvara') > 0.4
GROUP BY no, name
ORDER BY sim DESC
--
Robins Tharakan
On 11/08/2011 02:50 AM, Tarlika Elisabeth Sc
for GROUP BY)
--
Robins Tharakan
On 11/08/2011 03:29 PM, Tarlika Elisabeth Schmitz wrote:
Thank you for yuor suggestion, Robins. Unfortunately, it does not work;
this returns:
1787"Toomyvara" 0.5
1787"Toomevara" 0.4
1188"Toonybara" 0.4
because
Hi,
What all have you tried?
What are you getting stuck at?
Let us see some samples and may be someone could provide some input.
--
Robins
On 03/26/2012 01:19 PM, Rehan Saleem wrote:
hi,
i am trying to convert this mssql store procedure to postgresql function
but it is not giving me the
QL to
PostgreSQL.
--
Robins
On 03/24/2012 05:13 PM, Rehan Saleem wrote:
hi ,
how can we concatinate these lines and execute sql command
setsql = 'select user,username, firstname '
set sql += ' lastname, cardno from table1 where userid=' + 5
exec(sqi)
where 5 is the
seem to be
RETURNing the output immediately after the 'IF center_distance IS NULL'
condition.
Probably the RETURN needs to happen 'after' all the chr checks.
--
Robins
On 03/26/2012 03:48 PM, Rehan Saleem wrote:
hi ,
i have tried this but it is not working correctly , whe
gres=> RESET ROLE;
RESET
postgres=# DROP TABLE lock_tbl6;
DROP TABLE
postgres=# DROP TABLE lock_tbl5;
DROP TABLE
postgres=# REVOKE ALL ON SCHEMA lock_schema1 FROM lock_rol5;
REVOKE
postgres=# DROP ROLE lock_rol5 ;
DROP ROLE
postgres=#
Thanks
--
Robins Tharakan
l the best :)
Robins
On 10/24/07, Paul Lambert <[EMAIL PROTECTED]> wrote:
>
> Paul Lambert wrote:
> >
> > It's marked not null as a result of being part of the primary key for
> > that table which I can't really get around.
> >
> > I can get away
instead of void for this function.
*Robins*
On Feb 3, 2008 5:14 PM, sergey kapustin <[EMAIL PROTECTED]> wrote:
> Hello!
> Can anyone tell me how i do this properly?
>
> create or replace function agg(varchar,varchar) returns void as $func$
> select $1,count(*) from
ou could always use EXECUTE to run concatenated strings.
3. Unrelated, but as an advice, I always recommend giving field names while
inserting and intentionally try and and avoid insert statements such as
INSERT INTO xxx SELECT * .
*Robins*
-- Forwarded message --
From: Tizian
> It can be done, but it depends on how you are generating the value in the
> first function.
> If you sequences though you may have to take care of reverting it
> yourself.
>
> *Robins*
>
>
> -- Forwarded message --
> From: Jyoti Seth <[EMAIL PROT
, but in a given order, for e.g. ascending on date.
Is a FOR LOOP my best bet or is something like UPDATE ORDER BY in the
offing ?
Thanks
*Robins*
quot;
>
> As the document suggests you may want to try this way out:
>
> WHERE f.statecd IS NOT DISTINCT FROM p_statecd
>
> This would take care of both NULL and non-NULL values.
>
> *Robins*
>
>
> -- Forwarded message --
> From: Jyoti Seth &l
row.
essentially the third SQL statement works because it is equivalent to this:
SELECT 1 WHERE (A IS NULL AND C IS NULL) OR (A = C)
*Robins*
On Fri, Feb 22, 2008 at 10:00 PM, johnf <[EMAIL PROTECTED]> wrote:
> On Friday 22 February 2008 01:35:47 am Bart Degryse wrote:
> > C
>
> What version of PostGreSQL are you using ?
> Are you sure there was no typing error ? This SQL should work in the most
> recent version of PG.( at least version 8.1 onwards)
>
> *Robins*
>
>
> On Mon, Feb 25, 2008 at 10:50 AM, Jyoti Seth <[EMAIL PROTECTED]>
;s rule as a DO ALSO rule ... but that doesn't
work either)
Anyone else with some ideas ?
*Robins*
On Mon, Apr 14, 2008 at 10:17 PM, Chad Showalter <[EMAIL PROTECTED]>
wrote:
> I would like to create a rule that, by updating a view, allows me to
> update one table and insert i
ut of the
inner SQL query. The 'rownumber' could instead be calculated by simply
incrementing it within a FOR loop for each row.
*Robins*
On Wed, May 14, 2008 at 5:24 AM, Gavin 'Beau' Baumanis <
[EMAIL PROTECTED]> wrote:
> Hi Everyone,
>
> After spending some tim
Oops!
Of course, I meant a sequence.
*Robins*
On Wed, May 14, 2008 at 2:10 PM, Harald Fuchs <[EMAIL PROTECTED]>
wrote:
> In article <[EMAIL PROTECTED]>,
> "Robins Tharakan" <[EMAIL PROTECTED]> writes:
>
> > While we could always check for the query p
Probably you are looking for EXCEPT.
SELECT * FROM Tbl1 WHERE a=1
EXCEPT
SELECT * FROM tbl2 WHERE a=1 and b=1;
http://www.postgresql.org/docs/8.3/interactive/sql-select.html
Regards,
*Robins Tharakan*
-- Forwarded message --
From: Nacef LABIDI <[EMAIL PROTECTED]>
Date: Th
n1) and this makes a whole lot of difference in performance (since it now
uses the same index for n2 that it is using for n1).
In case of an INNER JOIN, shouldn't the second condition (in Query2) be
unnecessary ?
Or am I being unreasonable in this expectation ?
Regards,
*Robins Tharakan*
ue only for a direct
join. In the second query, the optimizer recommends a table scan even for a
simple IN() condition.
Is that normal ?
Regards,
*Robins Tharakan*
Query 1:
SELECT n1.scheme_code
FROM nav n1
INNER JOIN nav n2 ON n1.scheme_code = n2.scheme_code
WHERE n1.scheme_code = 290
&quo
23 matches
Mail list logo