L
L
LebedevStr2016-03-15 02:11:04
PHP
LebedevStr, 2016-03-15 02:11:04

How to make a multi table or trigger?

There is a table A.
prodid | catid
--------------------
Meaning 1 | 79
Value 2 | 59
Value 3 | 80
Value 4 | 50
Value 5 | 99
------------------------
There is a table B.
id | name
--------------------
79 | Cell 1
59 | Cell 2
80 | Cell 3
50 | Cell 4
99 | Cell 5
Need to get table C
prodid (A) and name (B)
prodid | name
--------------------
Value 1 | Cell 1
Value 2 | Cell 2
Value 3 | Cell 3
Value 4 | Cell 4
Value 5 | Cell 5
catid in table A refers to id in table B, from this table I need to "catch" the contents of the name cell.
I think a trigger will do here...
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey S., 2016-03-15
@LebedevStr

the question is googled in two seconds, these are the very basics of sql
, the JOIN operator will help you
www.skillz.ru/dev/php/article-Obyasnenie_SQL_obedi...

M
Markus Kelvin, 2016-03-15
@mmxdesign

select prodid, name from tableA a join tableB b on a.catid = b.id

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question