SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    Nov 2005
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Retrieving several fields PII

    Hi, attached is an illustration of my sample database. In my paymentmade table, I have to retrieved the payment of my customer in three entities (cash, check credit card), also I am going to get the services being rendered by the customer based on service classification. Please take note that the decription on my services table is different from customerfees table.
    Attached Images Attached Images
    Last edited by sirGE; Feb 4, 2009 at 20:53. Reason: attachment not done

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,341
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    what was your question?

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Addict
    Join Date
    Nov 2005
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried to do your advise by using CROSS JOIN, but I failed to create a query for my problem.

    How am I going to retrieved the paymentmade by the customer in terms of CASH, CHECK and Credit Card, also the services that the customer rendered.

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,341
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    have you ever written a join query before? one which returns results from more than a single table?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  5. #5
    SitePoint Addict
    Join Date
    Nov 2005
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah I wrote JOIN QUERY before...

  6. #6
    SitePoint Addict
    Join Date
    Nov 2005
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Had you ever tried writting a query to get the total daily collection? Say for example, you'll be getting the total collection for cash, check and cash and at the same, you'll be getting the collection for each services the customer it render.
    -------------------------------------------------------------------------
    Customer Name | Cash | Check |CreditCard | Service1 |Service 2| Service3
    John Donut |200.00 |______|_________ |__100.00_|___100.00|
    -------------------------------------------------------------------------


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •