database - How to export the data of a Mysql table including the values of referenced ID's of another table -


//i have updated question clarify things better i'm still @ loss. got appreciated can't work yet//

i'm still new @ this, new here well, hope i'll explain enough. if not, please let me know.

  1. i have 2 tables table 1 "students" , table 2 'mixed data"

tables

  1. table 1 "students" has columns "id", "name" , "experience"

    in column "experience" fields refer data table 2 "mixed data"

  2. i able export data of table "students" csv

i use export following query

select * outfile '/tmp/results.csv' fields terminated ',' enclosed '"' escaped '\\' lines terminated '\n' students; 
  1. in the file "results.csv" data of id's id's , not real value/name

i able export data csv , have values , not id reference in exported file.

current export result

id | name | experience
1 | gary | 5
2 | mary | 4

the number "4" , "5" in experience refers id in table 2 "mixed data"

result have in export .csv"

id | name | experience
1 | gary | super experienced
2 | mary | lots of experience

in export of csv experience field contains real values, being "super experience", "lots of experience"

is possible export data of table including values of referenced id's of table , if yes, how should adjust query.

thanks help.

it not problem. add desired table select statement, example -

select s.id, s.name, e.experience students s join experience e on s.id = e.id outfile '/tmp/results.csv' fields terminated ',' enclosed '"' escaped '\\' lines terminated '\n' 

Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -