Re: Last ID Problem

Поиск
Список
Период
Сортировка
От Vishal Kashyap @ [SaiHertz]
Тема Re: Last ID Problem
Дата
Msg-id 77b69d210501311218fb713d8@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Last ID Problem  (<operationsengineer1@yahoo.com>)
Список 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 по дате отправления:

Предыдущее
От: Mitch Pirtle
Дата:
Сообщение: Re: Last ID Problem
Следующее
От:
Дата:
Сообщение: Re: Last ID Problem