OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

SQL query and repeating values trouble

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
panosgr
General User
General User


Joined: 03 Apr 2008
Posts: 8

PostPosted: Sun Nov 01, 2009 11:39 pm    Post subject: SQL query and repeating values trouble Reply with quote

Hi from Athens,

I have a mySQL data base and I'm in big trouble with a query I want to make.

The datebase has 3 tables (related by the field customer_id)

table1:
customer_id
name

table2:
customer_id
charges_id
date
amount

table3:
customer_id
payement_id
date
amount

customer1 has 2 charges and 1 payement
customer2 has 0 charges and 0 payements
customer3 has 2 charges and 3 payements

the result of my query is:

customer_id charges_id payement_id
customer1 charge1 payement1
customer1 charge2 payement1
customer2 - -
customer3 charge1 payement1
customer3 charge2 payement2
customer3 charge2 payement3

How can I avoid to have this repeating data in some of the rows?

Any help will be very welcome!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group