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: 3914
9
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
Sheriff
Pie
Posts: 49808
69
  • 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
Marshal
Posts: 34851
369
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.
 
    Bookmark Topic Watch Topic
  • New Topic