ок. ответ будет завтра. дам возможность всем подумать. РедНек ответил правильно, но вопрос был найти конкретный amount, а не всё row.
4 main reasons why Boston is the best place to live:Red Sox (Baseball), Patriots (Football) World Champions
Celtics the NBA (Basketball), Bruins Stanley Cup (Hockey)
плин
поверили
в интернете ответов- завались на эту тему ))))))))))
Вот что нашел на интернете:
SELECT * FROM table_name WHERE column_name IN (SELECT MAX(column_name) FROM table_name WHERE column_name <> (SELECT MAX(column_name) FROM table_name))
ок. the simplest and most logical answer ( not related to any database):
select max(amount) from table A where amount != (select max(amount) from table A)
this one also will work:
select max(amount) from table A where amount < (select max(amount) from table A)
4 main reasons why Boston is the best place to live:Red Sox (Baseball), Patriots (Football) World Champions
Celtics the NBA (Basketball), Bruins Stanley Cup (Hockey)
select max(a) from abc where a< (select max(a) from abc);
( бир микс Cuba Libre 6-градусное )
create table abc ( a integer primary key);
insert into abc values (9),(8),(7),(6),(5),(4),(3),(2),(1),(0);
select max(a) from abc where a< (select max(a) from abc);
( это Oracle MySQL 5.* )
Last edited by crazy-mike; 05-03-2013 at 07:40 AM.
Жизнь дается человеку один раз и прожить ее надо так, чтобы не ошибиться в рецептах.
Строить Асгардию побуждает тьма, посетившая людские души
There are currently 1 users browsing this thread. (0 members and 1 guests)
|
|
Terms of Service | Privacy Policy |
|