Finding Max Value in a Row

Поиск
Список
Период
Сортировка
От Carlos Mennens
Тема Finding Max Value in a Row
Дата
Msg-id CAAQLLO6EhUi0OUi38BiH+qmgKqY+mY27_hGBQJiC5rbWorXQbw@mail.gmail.com
обсуждение исходный текст
Ответы Re: Finding Max Value in a Row  (Viktor Bojović <viktor.bojovic@gmail.com>)
Re: Finding Max Value in a Row  (Wes James <comptekki@gmail.com>)
Re: Finding Max Value in a Row  ("David Johnston" <polobo@yahoo.com>)
Re: Finding Max Value in a Row  (Thomas Kellerer <spam_eater@gmx.net>)
Список pgsql-sql
I have a problem in SQL I don't know how to solve and while I'm sure
there are 100+ ways to do this in ANSI SQL, I'm trying to find the
most cleanest / efficient way. I have a table called 'users' and the
field 'users_id' is listed as the PRIMARY KEY. I know I can use the
COUNT function, then I know exactly how many records are listed but I
don't know what the maximum or highest numeric value is so that I can
use the next available # for a newly inserted record. Sadly the
architect of this table didn't feel the need to create a sequence and
I don't know how to find the highest value.

Thank you for any assistance!


В списке pgsql-sql по дате отправления:

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: How change col name during query to use it in where clause
Следующее
От: Viktor Bojović
Дата:
Сообщение: Re: Finding Max Value in a Row