Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
    Bookmark Topic Watch Topic
  • New Topic

repeates each and everytime

 
vamshi g
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Report post to moderator
hi
my query:
selecta.url,a.title, b.ticket_name, b.networkcommission, c.commision,d.user_id from group_partner a,price b,partner_ticket_commision c,user_profile d where a.partnerid=? and c.partnerid=a.partnerid and b.evt_id=c.eventid and b.evt_id=? and first_name=?


am getting the output,but some values are repeating,how to avoid this
thanks.
 
Ananth Chellathurai
Ranch Hand
Posts: 349
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
Use joins.

Ananth Chellathurai
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
"select distinct" may be the easiest
 
Vijitha Kumara
Bartender
Posts: 3953
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Report post to moderator
You are not joining user_profile d in the where clause. Aren't there a connection between that table and the others used in the query. If so join that too.
 
Campbell Ritchie
Marshal
Posts: 53094
124
  • Mark post as helpful
  • send pies
  • Report post to moderator
"Vamshi g" you need to read your private messages pronto.
[ September 20, 2008: Message edited by: Campbell Ritchie ]
 
vamshi g
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Report post to moderator
There is no connection between user_profile and other tables.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Originally posted by vamshi g:
There is no connection between user_profile and other tables.


Then you are in the same situation you were in here
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 35975
422
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Then let's close this thread and continue conversation in the other. No point in having two parallel discussions about the same thing.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!