Re: Selecting max value from sets

2003-01-10 Thread Kent Vilhelmsen
On Thu, 2003-01-09 at 22:06, Benjamin Dixon wrote:
 
 Hi all,
 
 I'm trying to figure out a way to select a group of maximums from a set
 such that each value pair's greatest value is in the result set. For
 example, let's say I have this table Value_Pairs:
 
 Name | Value
 
 Bob1
 Joe7
 Bob2
 Don3
 Don4
 Bob6
 
 The result I want is like this:
 
 Name | Value
 
 Bob6  //Bob's highest value in the table
 Joe7  //Joe's highest value in the table
 Don4  //Don't highest value in the table
 


The following might work: 



mysql select name,max(val) from res group by name ;
+--+--+
| name | max(val) |
+--+--+
| Bob  |6 |
| Don  |4 |
| Joe  |7 |
+--+--+
3 rows in set (0.00 sec)



Regards, KentV





---
|  /   / KENT VILHELMSEN  - Eniro
| /   /
|/\  /   mob +47 40213917 OSLO +47 22583917 STH +46 87043619
/  \/*  Standardise your content to fit ALL browsers!  * 
---



 So I'm looking for distinct maximums.
 Is it possible to do this *with a single query* in MySQL? I've tried a
 number of things and nothing comes close.
 
 ben
 
 
 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: MySQL vs. Oracle (not speed)

2002-08-16 Thread Kent Vilhelmsen


We've been using Oracle, Sybase, MS SQL, DB2 and even other databases in
our company, and we've decided to go with - mainly - MySQL. We didn't
really have a hard time convincing the management about this decision,
since we produced a whole Open Source-strategy at the same time,
giving some design principles that gives us as much flexibility and
scalability as possible. 

One of these, regarding databases, is that we want to minimize the use
of stored procedures. Stored procedures are of course nice in many cases
- they save network traffic, speed up queries, eases the application
programmers tasks and so on; but they are certainly not flexible in that
you can easily change your database vendor without having to rewrite
your code. Therefore, since flexibility means most to us, we've chosen
to move as much of the logic as possible up to the layers above the
database (for example, in ejbs). Oracle is of course brilliant for
banking, finance, government databases etc. - but probably waste of
money for web-portals, e-commerce and so on. 

The result is that it's easy to swap any components in the platform that
we're not satisfied with, for example the database. Also, we see that
MySQL delivers most of the functionality we want, including hot-backups
(using InnoDB), fulltext searches and foreign keys. Armed with systems
like linux, jBoss, Resin, ant, junit, xdoclet, middlegen, apache, perl
and many more, I believe our platform is about as good as it can be. 

We are of course lucky NOT to have top-managers who think they know more
about technology than the tech-department ;-)

Regards, Kent Vilhelmsen
Head of Systems Architecture
Eniro/Scandinavia Online








On Fri, 2002-08-16 at 15:07, Mary Stickney wrote:
 
 It doesn't suport alot of differnt things
 it dosent have store procedures , dosent have a complete SQL command set...
 
 I am using it becasue I am being forced to...
 
 
 
 -Original Message-
 From: Elizabeth Bogner [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 15, 2002 9:25 PM
 To: [EMAIL PROTECTED]
 Subject: MySQL vs. Oracle (not speed)
 
 
 
 A company I work with is in the process of upgrading its databases from
 some
 motheaten system to something current. My impression is that they
 want to go with Oracle, and I'm not sure if this is based on anything
 other than being impressed with the size and presumed quality support
 of Oracle. I'd like to encourage them to at least seriously consider
 using
 MySQL instead.
 
 I don't think that speed is a huge factor here; we do a lot of XML
 publishing
 and content management, but at most we'd have several gigabytes of
 data and several dozen simultaneous users, so well within the
 capabilities
 of MySQL. I've looked at various things I could find, like the benchmarks
 pages (probably not relevant) and the MySQL myths page, which was
 somewhat helpful, but I couldn't find anything more along the lines of
 How to Convince my Management to go with MySQL. I don't even know
 what to expect from them, but I'm imagining they'll say, But MySQL
 doesn't support sub-selects, to which I can reply, But you can write
 most of those as joins anyway, so it won't matter because the software
 will all be written from scratch. Etc.
 
 Are there pointers anyone can give me?
 
 E. Bognewitz
 
 
 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
 [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 
 
 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
-- 
---
|  /   / Kent Vilhelmsen
| /   /Head of System Architecture  Scandinavia Online
|/\  /   mob +47 40213917 desk +47 22583917 off +47 22583800 
/  \/*  Standardise your content to fit ALL browsers!  * 
---

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php