If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Help me with a question..PLEASE

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-23-09, 16:15
Antonioj1015 Antonioj1015 is offline
Registered User
 
Join Date: Aug 2009
Posts: 13
Question 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::..
Reply With Quote
  #2 (permalink)  
Old 08-23-09, 16:39
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
WTF?

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

Help with mysql, PLEASE

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

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 08-23-09, 16:41
Antonioj1015 Antonioj1015 is offline
Registered User
 
Join Date: Aug 2009
Posts: 13
Quote:
Originally Posted by r937
WTF?

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

Help with mysql, PLEASE

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::..
Reply With Quote
  #4 (permalink)  
Old 08-23-09, 19:51
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
sorry, no more free homework answers, you have to do them yourself
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 08-23-09, 20:47
Antonioj1015 Antonioj1015 is offline
Registered User
 
Join Date: Aug 2009
Posts: 13
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::..
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On