Re: [SQL] Counting Row

2005-07-24 Thread Pascual De Ruvo
I understand you need to count of tickets smaller than $recid given [CONDITION], in that case: $sql="select count(*) from [MYTABLE] where [CONDITION] and ticketnumber <=" . $recid  ; On 7/21/05, Ricky Sutanto <[EMAIL PROTECTED]> wrote:   Hi postgre people. Can anybody help to fix per

Re: [SQL] Different encodings in different DBs in same cluster

2005-07-24 Thread Tom Lane
Jamie Lawrence <[EMAIL PROTECTED]> writes: > I see: >Since these locale settings are frozen by initdb, the apparent >flexibility to use different encodings in different databases of a >cluster is more theoretical than real. > Does anyone know what "more theoretical than real" mean in

Re: [SQL] Counting Row

2005-07-24 Thread PFC
I'd suggest : - first getting the 'order fields' value for the ticket you want : SELECT field_order FROM mytable WHERE condition AND identifier=the_one_you're_looking_for ORDER BY field_order DESC LIMIT 1 - then counting all the tickets up to this order : SELECT count(*) FROM mytable WHERE

Re: [SQL] ids from grouped rows

2005-07-24 Thread Weinzierl Stefan
Lindsay schrieb: > Lets say i do this: > > SELECT name, MAX(age) > FROM Person > GROUP BY name > > This will group people who have the same name together, and return the > highest age for each group. I want to be able to find the id for the > person with the highest age in each group - > > Idea

[SQL] Different encodings in different DBs in same cluster

2005-07-24 Thread Jamie Lawrence
Hi All, I was going through the docs for Postgres 8 for info on setting the character set (to UTF8). In the docs here: http://www.postgresql.org/docs/8.0/interactive/multibyte.html#MULTIBYTE-CHARSET-SUPPORTED I see: Since these locale settings are frozen by initdb, the apparent flexibil

[SQL] Counting Row

2005-07-24 Thread Ricky Sutanto
Hi postgre people. Can anybody help to fix performance of my query?   Let say, I have n number of queue ticket. (Which I use SELECT). Is there faster method to know where is my ticket number in queue?   I use (while in PHP script ) and  count one by one until my ticket number match wit

[SQL] Counting Row

2005-07-24 Thread Ricky Sutanto
  Hi postgre people. Can anybody help to fix performance of my query?   Let say, I have n number of queue ticket. (Which I use SELECT). Is there faster method to know where is my ticket number in queue?   I use (while in PHP script ) and  count one by one until my ticket number match

Re: [SQL] difference between all RDBMSs

2005-07-24 Thread Alexander Schreiber
Dhanashree <[EMAIL PROTECTED]> wrote: > > i m an engineering student and i m looking out for differrences between > oracle v/s sybase v/s sql v/s plsql v/s mysql with respect to the following > points > 1. rdbms > 2. data independence > 3. support of plsql > 4. integrity > 5. security > 6. us

Re: [SQL] solved: Coalesce() in outer join between views

2005-07-24 Thread Chris Travers
Hi all; I found the problem (stupid human error ;-) ) Basically it was a broken join condition. Best Wishes, Chris Travers Metatron Technology Consulting begin:vcard fn:Chris Travers n:Travers;Chris email;internet:[EMAIL PROTECTED] x-mozilla-html:FALSE version:2.1 end:vcard ---