Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2009
    Posts
    18

    Question Unanswered: Help me with a question..PLEASE

    heres the thing, i made a table named Employees
    +----------+-------------+------+-----+---------+-------+
    | Field | Type | Null | Key | Default | Extra |
    +----------+-------------+------+-----+---------+-------+
    | Doc | varchar(5) | NO | PRI | NULL | |
    | Name | varchar(20)| NO | | NULL | |
    | Salary | varchar(7) | NO | | NULL | |
    | City | varchar(10)| NO | | NULL | |
    | Boss | varchar(5) | YES| | NULL | |
    +----------+-------------+------+-----+---------+-------+
    In this table theres Doc (which is document and the primary key) of the employee, the name of the employee, the salary of the employee, the city in which the employee is at, and the boss which is the Doc.
    so i put some info in and it looks like this:
    +-------+----------+---------+----------+-------+
    | Doc | Name | Salary | City | Boss |
    +-------+----------+---------+----------+-------+
    | 10305 | Joey | 700 | NYC | NULL |
    | 10244 | John | 900 | Boston | 10305 |
    | 35357 | Mary | 600 | Boston | 10305 |
    | 90012 | Becky | 650 | Miami | 35357 |
    +-------+----------+---------+----------+-------+
    as you can see Joey is the boss of John and Mary, And Mary is the boss of becky.
    How can i show the information of the employees who earn more money than their boss, which is John and becky?
    And how do i show the boss that has 2 or more employees?

    THANKS so much and is not to much to ask can you explain me...THANKSSS
    ..::Antonioj1015::..

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    WTF?

    why would you repost this question when i already gave you the answer?

    http://www.dbforums.com/mysql/164678...ql-please.html

    if you did not appreciate my solution, please at least have the courtesy to explain why

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Aug 2009
    Posts
    18
    Quote Originally Posted by r937
    WTF?

    why would you repost this question when i already gave you the answer?

    http://www.dbforums.com/mysql/164678...ql-please.html

    if you did not appreciate my solution, please at least have the courtesy to explain why


    yes your answer was very helpufull indeed and thanks, but if you read i have 2 more questions that are diferent to the one i asked you, iy you could help me with this 2 questions i would really apreciated, thanks
    ..::Antonioj1015::..

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    sorry, no more free homework answers, you have to do them yourself
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Aug 2009
    Posts
    18
    Quote Originally Posted by r937
    sorry, no more free homework answers, you have to do them yourself
    Hey since you know so much could you explain me the first one you did, i know the dot is a pointer, but why did you put employees as empl, i just want to learn and its not homework...
    ..::Antonioj1015::..

Posting Permissions

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