Stack Overflow em Português Asked by Leno Sousa on December 11, 2020
$catalog = $dbh->prepare("SELECT * FROM catalogo WHERE ativo = 2 ORDER BY catalogo_view DESC LIMIT 0,5");
$catalog->execute();
Quero buscar entre duas tabelas, como faço?
Tente usar UNION, mas lembrando que no UNION as colunas da consulta tem que ter a mesma quantidade.
SELECT cliente_codigo, cliente_nome FROM cliente
UNION SELECT funcionario_codigo, funcionario_nome FROM funcionario
WHERE ativo = 2
Answered by graciomar on December 11, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP