Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql anywhere 10 grouping

Status
Not open for further replies.

acn242

IS-IT--Management
Nov 28, 2006
39
0
0
US
i am pretty new to transact sql, i have been working in mysql
but this simple query returns the same results with or without the group by clause. i would like just one row per customerid

#########
select c.customerid, c.firstname, c.lastname, co.name, cod.custorderdetailid
from c02.customer c, c02.custorder co, c02.custorderdetail cod
where c.customerid=co.customerid and co.custorderid=cod.custorderid
and custtype=4
group by c.customerid, c.firstname, c.lastname, co.name, cod.custorderdetailid
order by c.lastname
################
 
If there are multiple orders per customer, which one would you like to see?

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
it doesn't matter, i just thought that it would select one(by id possibly), but guess not

i'll just remove from select statement

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top