+ 2

What is a "Virtual Table", in SQL?

2nd Apr 2017, 8:42 PM
Nathaniel Warren
Nathaniel Warren - avatar
2 Respuestas
+ 2
Felipe, thanks for the help. Great answer...
3rd Apr 2017, 2:36 PM
Nathaniel Warren
Nathaniel Warren - avatar
+ 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!
3rd Apr 2017, 12:53 PM
Felipe Cruz
Felipe Cruz - avatar