|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
How not to repeat the same column ?
hi i'm a beginner in mysql and this is my 1st visit 2 this forum wish u can help me
i have 2 tables the 1st containe column emp_num (primary) the 2nd contains column emp_num (foreign) i want 2 show all information in the 2 tables about employees without repeating the same column (emp_num) select * from workers , inf where workers.emp_num = inf.emp_num; the column emp_num appears twice in the result table what's the solution |
|
#2
|
|||
|
|||
|
the most simple way would be to write the specific columns you wish instead of everything. for example, if the inf have an id, a name and the emp_num, the select would be:
select workers.*, inf.id, inf.name from workers, inf where workers.emp_num = inf.emp_num
__________________
Benjamin Horsleben horsleben.com/benjamin Don't blame malice for what stupidity can explain |
|
#3
|
|||
|
|||
|
thanks alot
and we can do this select workers.* , inf.event , inf.email from workers inner join inf on workers.emp_num = inf.emp_num; but the solution you posted is easier i think thanks again |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > How not to repeat the same column ? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|