[thelist] Weird SELECT DISTINCT error
Matt Warden
mwarden at gmail.com
Thu Dec 15 22:58:53 CST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Brian Cummiskey wrote:
> I ran a sample query on a table before I posted this.
>
> table is set up like:
>
> id name
> 1 bob
> 2 jane
> 3 mary
>
>
> I threw some non-unique ID numbers in, and ran the query.
>
> In mssql 2000, it pulled the unique ID's only, and the first name with
> such record for the query of SELECT distinct id, name.
>
> Unless my sql is server is different???
So, for something like this:
id name
1 bob
1 matt
2 jane
3 mary
select distinct id, name from table;
what does it do for id 1?
- --
Matt Warden
Miami University
Oxford, OH, USA
http://mattwarden.com
This email proudly and graciously contributes to entropy.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDokmNrI3LObhzHRMRAm1bAKCrtrA1S788vM+CCIScOS8w1zpwuQCg7g+a
8Sdomk2y1uTEIzYkFY6Jqmk=
=/xUp
-----END PGP SIGNATURE-----
More information about the thelist
mailing list