Mysql question
Posted: 2020-04-20 11:33
Hello
Sorry if this is a stupid question but i am new to mysql use… with this times with covid , i try to help the clinic workflow where i work but i am stuck on a copy thing from data tables….
So, i have 2 tabels A and B.
A has 3 fields: id , name , code. (where code is a number between 1 and 30 (code 1 - irm ; code 2 - ct ; code 3 - ecography)
id name code
1 IRM 1
2 CT 2
3 Ecography 3
etc
B has 3 fields: id, name , investigation (where name is the same as A fields name and investigation SHOULD be the name from the A name field (but acording to the code)
id name investigation_code
1 Arthur M. 2
2 Athen A. 1
3 Martha A. 3
4 Marin V. 3
etc
I need to get the name from the TABLE A (where CODE has a NAME) and WRITE in the B table in investigation with the NAME (replace the CODE with the TEXT). So where is code 1 to write to table B field investigation “IRM" , where is code 2 to write table B on investigation field “CT†etc.
I need this results (in the B table to WRITE in the db the text name of investigation in sted of investiogation CODE)
id name investigation
1 Arthur M. CT
2 Athen A. IRM
3 Martha A. Ecography
4 Marin V. Ecography
etc
Please help me, i apriciate.
Have a nice day!
Dr. Filipiuc Ciprian
Sorry if this is a stupid question but i am new to mysql use… with this times with covid , i try to help the clinic workflow where i work but i am stuck on a copy thing from data tables….
So, i have 2 tabels A and B.
A has 3 fields: id , name , code. (where code is a number between 1 and 30 (code 1 - irm ; code 2 - ct ; code 3 - ecography)
id name code
1 IRM 1
2 CT 2
3 Ecography 3
etc
B has 3 fields: id, name , investigation (where name is the same as A fields name and investigation SHOULD be the name from the A name field (but acording to the code)
id name investigation_code
1 Arthur M. 2
2 Athen A. 1
3 Martha A. 3
4 Marin V. 3
etc
I need to get the name from the TABLE A (where CODE has a NAME) and WRITE in the B table in investigation with the NAME (replace the CODE with the TEXT). So where is code 1 to write to table B field investigation “IRM" , where is code 2 to write table B on investigation field “CT†etc.
I need this results (in the B table to WRITE in the db the text name of investigation in sted of investiogation CODE)
id name investigation
1 Arthur M. CT
2 Athen A. IRM
3 Martha A. Ecography
4 Marin V. Ecography
etc
Please help me, i apriciate.
Have a nice day!
Dr. Filipiuc Ciprian