+ 2
What is a "Virtual Table", in SQL?
2 Respostas
+ 2
Felipe, thanks for the help. Great answer...
+ 1
From the perspective of an SQL statement, the virtual table object looks like any other table.
SQL statements can do almost anything to a virtual table that they can do to a real table, with some exceptions.
The best way is using the SELECT to populate the virtual table in one SQL statement. You might try to create a virtual table in one SQL statement, and then do the join in a second. However, that can brings up transaction issues.
---------------------------------------------------
Implementation that I did on a real life situation:
SELECT clientes.idClientes, clientes.Nome, clientes.titular ,canais.idcanais,
canais.Nome_Canal FROM assess.chadquiridos
JOIN assess.canais ON canais.idcanais = chadquiridos.idch
JOIN assess.clientes ON clientes.idClientes = chadquiridos.idcli;
Its a manytomany situation where we get together the customers and the channels that they rent on a virtual table.
Sadly it is in portuguese, but I am sure that you can figure it out!