Search Postgresql Archives

find next in an index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I am trying to find out how to get the next record according to a
particular index.
I have a table with a name field and a serial field.  The name field
isn't unique so I made an index on name(varchar) & serialno(bigserial).
I also have an index just on 'name'.  I am having trouble working out
the syntax for the query.

select * from table where name>='jack' and serialno!='2' 
order by name,serialno;

I don't think this will work under all circumstances.

Any help appreciated. Thanks.





---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux