Select DISTINCT not very useful...
Michael Geary
listmail at gearyweb.com
Fri Oct 24 13:59:58 CDT 2003
Hi Folks,
Can anyone explain for me how _exactly_ the DISTINCT keyword works in
Valentina? I've got a query that returns two columns, and I want only
to receive unique combinations. Essentially, unique rows of returned
values. In MySQL, I can do this using GROUP BY, but that appears to
have NO impact on my VDB. Neither does DISTINCT.
For what it's worth, here is my query. As you can see, I'm retrieving
one column per table, and I'm interested in only unique combinations:
SELECT
ImageMap.StructureNumber,
structure.structurename
FROM
ImageMap,
structure
WHERE
structure.structurenumber = imagemap.structurenumber
and ImageMap.Image = '5812_3d'
---------------
My results (in V4MD) are like this:
[#StructureNumber: 2970, #StructureName: "Gastrocnemius"],
[#StructureNumber: 2970, #StructureName: "Gastrocnemius"],
[#StructureNumber: 2970, #StructureName: "Gastrocnemius"],
[#StructureNumber: 2970, #StructureName: "Gastrocnemius"],
[#StructureNumber: 2970, #StructureName: "Gastrocnemius"],
[#StructureNumber: 2970, #StructureName: "Gastrocnemius"],
[#StructureNumber: 92, #StructureName: "femur"],
[#StructureNumber: 92, #StructureName: "femur"],
[#StructureNumber: 92, #StructureName: "femur"],
[#StructureNumber: 92, #StructureName: "femur"],
[#StructureNumber: 92, #StructureName: "femur"],
[#StructureNumber: 92, #StructureName: "femur"],
[#StructureNumber: 92, #StructureName: "femur"],
[#StructureNumber: 92, #StructureName: "femur"],
This ought to be two hits, not several.
I'd appreciate your insights,
michael geary
More information about the Valentina
mailing list