sonkinha 0 Posted March 28, 2011 Report Share Posted March 28, 2011 Boas. Tenho um problema a visualizar dados das minhas tabelas. Tenho as tabelas "A" "B" "C" "D" Cada tabela tem os campos "Nome" "2" "3" "ID" Quero visualizar os dados em todas as tabelas onde o "Nome" é "asd" (O nome não é primary key, mas mesmo assim é único em todas as tabelas). Já tentei st = conn.createStatement(); xt = "select * from A, B, C, D where Nome='"+Nomed+"';"; rs = st.executeQuery (xt); Mas isto dá erro "Column 'Nome' in where clause is ambiguous" (provavelmente não sabem em que tabela escolher) Como é que faço para procurar em todas as tabelas? Link to post Share on other sites
brunoais 65 Posted March 28, 2011 Report Share Posted March 28, 2011 st = conn.createStatement(); xt = "select * from A, B, C, D where A.Nome='"+Nomed+"' OR B.Nome='"+Nomed+"' OR C.Nome='"+Nomed+"'..."; rs = st.executeQuery (xt); "[Os jovens da actual geração]não lêem porque não envolve um telecomando que dê para mirar e atirar, não falam porque a trapalhice é rainha e o calão é rei" autor: thoga31 Life is a genetically transmitted disease, induced by sex, with death rate of 100%. Link to post Share on other sites
VagnerChines 0 Posted March 30, 2011 Report Share Posted March 30, 2011 Tenta utilizar Views e/ou inner join Link to post Share on other sites
sonkinha 0 Posted March 30, 2011 Author Report Share Posted March 30, 2011 Esse problema está resolvido. Mas agora veio outro. O meu netbeans pelos vistos não tem memória suficiente. Com tantas tabelas que tenho e com tantos dados em cada tabela dá-me erro! É melhor desistir desta função e passar a outra 😡 Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now