[SQL] look for latest user login in one table from a list of users in another

2003-03-14 Thread Sill-II, Stephen
I'm trying to come up with an efficient way to do the following task, but I haven't found the correct join syntax to do it. I have table "users" for keeping a list of users I need to check logins for. It contains the following fields: id,Full-Name,User-Name I have table called "logs" that contai

Re: [HACKERS] [SQL] What's wrong with this group by clause?

2003-03-14 Thread Franco Bruno Borghesi
Thanks Tom, I applied the patch and it works perfect now. Thanks to you all. On Thursday 13 March 2003 14:02, Tom Lane wrote: > Manfred Koizar <[EMAIL PROTECTED]> writes: > > ISTM you have found a Postgres 7.3 bug. > > Yeah. Actually, the planner bug has been there a long time, but it was > only

Re: [SQL] Poor performance on a right join

2003-03-14 Thread dev
> When doing a join query I am getting a responce time of 3 seconds. The > callhist table has 66000 rows and the phone table has 1 rows. I > have an indexes on callhist.call_date, callhist.operator_id, > phone.phone, & phone.cust_code. Here's the SQL > SELECT a.CALL_DATE, a.OPERATOR_ID, a.CUST_

Re: [SQL] What's wrong with this group by clause?

2003-03-14 Thread Manfred Koizar
On Thu, 13 Mar 2003 01:34:34 -0600, "Len Morgan" <[EMAIL PROTECTED]> wrote: >>GROUP BY > > field1, > > field2, > >name; >I think the problem is that you don't have a column to group on. field1, field2, and name are the grouping columns. >Try adding >SELECT ,count(*) so that there is an

Re: [SQL] View - Join based on dis-similar data types

2003-03-14 Thread Richard Huxton
On Thursday 13 Mar 2003 1:48 pm, speakeasy wrote: > Not sure if this ever made it to the group, I can't seem to find it in the > recent message lists. > > "speakeasy" <[EMAIL PROTECTED]> wrote in message news:... > > > I have a field defined as a character(50) data type, and the same field > > stor

Re: [SQL] Deleting large object from table pg_largeobject

2003-03-14 Thread Richard Huxton
On Wednesday 12 Mar 2003 8:59 pm, David wrote: > Hello, > > I'm trying to delete a large object form the pg_largeobject table but I > get a permission denied error (in both psql and with the java JDBC ). > > Here is my sql stament in order: > > fletcher=> SELECT * from md_blob ; > blob_id | text