Author
repeates each and everytime
vamshi g
Greenhorn
Joined: Sep 12, 2008
Posts: 26
posted Sep 20, 2008 01:40:00
0
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
Joined: Nov 21, 2007
Posts: 348
posted Sep 20, 2008 01:42:00
0
Use joins. Ananth Chellathurai
Ananth Chellathurai [Walk on software ]
David O'Meara
Rancher
Joined: Mar 06, 2001
Posts: 13459
posted Sep 20, 2008 02:23:00
0
"select distinct" may be the easiest
Vijitha Kumara
Bartender
Joined: Mar 24, 2008
Posts: 3670
posted Sep 20, 2008 02:47:00
0
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.
SCJP 5 | SCWCD 5
[How to ask questions ] [Twitter ]
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32708
posted Sep 20, 2008 02:47:00
0
"Vamshi g" you need to read your private messages pronto. [ September 20, 2008: Message edited by: Campbell Ritchie ]
vamshi g
Greenhorn
Joined: Sep 12, 2008
Posts: 26
posted Sep 20, 2008 02:54:00
0
There is no connection between user_profile and other tables.
David O'Meara
Rancher
Joined: Mar 06, 2001
Posts: 13459
posted Sep 20, 2008 04:28:00
0
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
internet detective
Marshal
Joined: May 26, 2003
Posts: 26200
posted Sep 20, 2008 11:44:00
0
Then let's close this thread and continue conversation in the other. No point in having two parallel discussions about the same thing.
[Blog ] [JavaRanch FAQ ] [How To Ask Questions The Smart Way ] [Book Promos ]
Blogging on Certs: SCEA Part 1 , Part 2 & 3 , Core Spring 3 , OCAJP , OCPJP beta , TOGAF part 1 and part 2
subject: repeates each and everytime