We help IT Professionals succeed at work.

mysql create sudo table

teera
teera asked
on
Can i create sudo table
i have table a  and feild a1  Table b and feiild feild b1 and a1 is use for link  how can i create sudo table

name table c that link Table a and table b
Comment
Watch Question

IT Supervisor
Top Expert 2009
Commented:
What you want is called a VIEW.  I'm assuming you have other fields (like 'a2' in table 'a' and 'b1' and 'b2' in table 2):
CREATE VIEW c
AS
SELECT a.a1, a.a2, b.a1, b.b1, b.b2
FROM a, b
WHERE a.a1 = b.a1
;

Open in new window

And now you can:
SELECT *
FROM c
;

Open in new window

And it's just like you did the longer query.  You can treat 'c' almost like it is a table (don't try to do any complex INSERTs into it, though).