File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
    Bookmark Topic Watch Topic
  • New Topic

repeates each and everytime

 
vamshi g
Greenhorn
Posts: 26
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
Use joins.

Ananth Chellathurai
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
"select distinct" may be the easiest
 
Vijitha Kumara
Bartender
Posts: 3908
9
Chrome Fedora Hibernate
  • 0
  • 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
Sheriff
Pie
Posts: 47250
52
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • 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.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic