Re: [SQL] Need help paging through record sets

2002-12-20 Thread Steve Crawford
Sort of depends on the nature of your application. You can use offset to get specific chunks: select * from foo order by date limit 100 offset 100; You should be aware, however, that on a very large table this can be quite inefficient as you will have to do the select and sort on the large tabl

[SQL] Need help paging through record sets

2002-12-20 Thread cmccormick
Hello everyone, and thanks for reading my first newbie post. :-) I am a neopyhte PHP and postgreSQL user, with a website at www.the-athenaeum.org. We store (among other things) artworks, which people can view in a list, sorted by artist name, date, medium, etc. We now have enough works that I

[SQL] SQL select count(*) from "myTable" failed : Relation "mytable" does not exist

2002-12-20 Thread Jeff Kowalczyk
What do these errors mean? I get them on certain databases when trying to view table data in webmin's postgresql module. I don't think its Webmin specific. The databases in question are often exported from Access XP using pgAdmin 1.4.2 and the migration plugin (and imported using psql -f), but I al

Re: [SQL] Help on (sub)-select

2002-12-20 Thread Philip Warner
At 11:48 AM 20/12/2002 +, Gary Stainburn wrote: > select r.*, count(*) from roster r, roster_staff s > where rsdate = rodate and rsgid = rogid and rsgsid = rogid > group by r.* This one came up with a parser error near '*' but I don't understand it enough to debug it. Replace

Re: [SQL] Help on (sub)-select

2002-12-20 Thread Gary Stainburn
On Friday 20 Dec 2002 10:51 am, Philip Warner wrote: > At 10:21 AM 20/12/2002 +, Gary Stainburn wrote: > >nymr=# select r.*, s.tally from roster r, > >nymr-# (select count(*) as tally from roster_staff where > >nymr(# rsdate = '2002-01-01' and rsgid = 11 and rsgsid = 2) as s > >nymr-#

Re: [SQL] Help on (sub)-select

2002-12-20 Thread Philip Warner
At 10:21 AM 20/12/2002 +, Gary Stainburn wrote: nymr=# select r.*, s.tally from roster r, nymr-# (select count(*) as tally from roster_staff where nymr(# rsdate = '2002-01-01' and rsgid = 11 and rsgsid = 2) as s nymr-# where rodate = '2002-01-01' and rogid = 11 and rogsid = 2; ro

[SQL] Help on (sub)-select

2002-12-20 Thread Gary Stainburn
Hi Folks, I have two tables roster holds the duties to be performed and the number of people required per duty. roster_staff holds the people allocated to perform that duty. I'm trying to create a select that will tally the roster_staff and include it with the roster details. I've managed to

Re: [SQL] UPDATE with a SELECT and subSELECT(About comparing dates and non dates data)

2002-12-20 Thread Christoph Haller
> > Typing what you told me there was an errror; I' ve changed it slightly an it > seems that this sintax is correct. I say "it seems" because the computer > begins to process the query but doesn't finish it. I've leaved it working for > more than half an hour, before cancel it, with no result. > >