Re: Last ID Problem - Mailing list pgsql-novice

From Vishal Kashyap @ [SaiHertz]
Subject Re: Last ID Problem
Date
Msg-id 77b69d210501311218fb713d8@mail.gmail.com
Whole thread Raw
In response to Re: Last ID Problem  (<operationsengineer1@yahoo.com>)
List pgsql-novice
Hi ,

> will your suggestion protect my db if I have two
> customers with the same name?

Yes , it would with the consideration that the sequence used to create
the cust_id is increasing  by some number , customer may have same
name but in all means the customer name which is having the MAXIMUM
cust_id is ur need.

>  does it always return
> the highest cust_id and is that *always* the last
> cust_id entered?
>

did i said I gave you a query that would run faster you may alternatively use

 $id = "SELECT max(cust_id) from customer  where  customer_name ='$cust' " ;

Use explain in psql and u will know why I suggested the previous query.


--
With Best Regards,
Vishal Kashyap.
Lead Software Developer,
http://saihertz.com,
http://vishalkashyap.tk

pgsql-novice by date:

Previous
From: Mitch Pirtle
Date:
Subject: Re: Last ID Problem
Next
From:
Date:
Subject: Re: Last ID Problem