Re: compare table names - Mailing list pgsql-sql

From Adrian Klaver
Subject Re: compare table names
Date
Msg-id 201201090833.24042.adrian.klaver@gmail.com
Whole thread Raw
In response to compare table names  (Tony Capobianco <tcapobianco@prospectiv.com>)
List pgsql-sql
On Monday, January 09, 2012 8:12:18 am Tony Capobianco wrote:

>      tablename
> --------------------
>  tmp_staging0109
>  tmp_staging1229
>  tmp_staging0108
> 
> How can I write this correctly?

Had another idea. If you are looking for the highest numbered table below a 
certain number then maybe this:

test(5432)aklaver=>\d name_test        Table "public.name_test"Column |       Type        | Modifiers 
--------+-------------------+-----------fld_1  | character varying | 

test(5432)aklaver=>SELECT * from name_test ;     fld_1      
-----------------
                                                          tmp_staging0109

tmp_staging0108
                                                        tmp_staging1229
                                                                                                                 
 
(3 rows)

                                                                                                                   
 
test(5432)aklaver=>select fld_1 from name_test where fld_1 like 'tmp_staging%' and 
fld_1< 'tmp_staging1230' order by fld_1 desc limit 1;                                     fld_1

                     
 
-----------------
                                                          tmp_staging1229                      
 


> 
> Thanks.
> Tony

-- 
Adrian Klaver
adrian.klaver@gmail.com


pgsql-sql by date:

Previous
From: Tony Capobianco
Date:
Subject: Re: compare table names
Next
From: "Greg Sabino Mullane"
Date:
Subject: Re: compare table names