easy one for SQL people 
Author Message
 easy one for SQL people
I need a query, and since I don't know sql very well I could use some help
I have a table with 2 columns Bid and email address

I need a query that returns the highest value from bid column and the email
address assoicated with that amount, thanks



Thu, 05 Dec 2002 03:00:00 GMT
 easy one for SQL people

Ken,

create table Ken
(
 Bid int,
 Email varchar (255)
)
go




select *
from Ken
where Bid = (select max(Bid)
                   from Ken)

---------------------------------------------------------------
BP Margolin
Please reply only to the newsgroups.
When posting, inclusion of SQL (CREATE TABLE ..., INSERT ..., etc) which can be
cut and pasted into Query Analyzer is appreciated.


Quote:
> I need a query, and since I don't know sql very well I could use some help
> I have a table with 2 columns Bid and email address

> I need a query that returns the highest value from bid column and the email
> address assoicated with that amount, thanks



Thu, 05 Dec 2002 03:00:00 GMT
 easy one for SQL people
or

select top 1 * from Ken order by Bid desc

/johan


Quote:
> Ken,

> create table Ken
> (
>  Bid int,
>  Email varchar (255)
> )
> go




> select *
> from Ken
> where Bid = (select max(Bid)
>                    from Ken)

> ---------------------------------------------------------------
> BP Margolin
> Please reply only to the newsgroups.
> When posting, inclusion of SQL (CREATE TABLE ..., INSERT ..., etc) which
can be
> cut and pasted into Query Analyzer is appreciated.



> > I need a query, and since I don't know sql very well I could use some
help
> > I have a table with 2 columns Bid and email address

> > I need a query that returns the highest value from bid column and the
email
> > address assoicated with that amount, thanks



Fri, 06 Dec 2002 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Two questions... one easy, one hard

2. easy one converting access database files to SQL Data files

3. Easy one: importing to SQL 6.5 from Access

4. Here's an easy one, I'm sure (from a new SQL 6.5 user)

5. Sql Server and ODBC Access2000 - fairly easy one I think

6. Be one of the Beautiful People!!!

7. 2 questions (One for linux people)

8. Be one of the Beautiful People!!

9. Q: Finding people with more than one criteria

10. one for college people - class timetables with FMP?

11. another easy one


 
Powered by phpBB® Forum Software