Questions tagged as 'join'

1
answer

SQL server 2012, ex correction

checkiftheexerciseanswerbelowiscorrect:Listthenamesofcustomers(Cli_Nome)whoholdBONUSNOTNULLandthattheypurchasedproductswithacode(%w/w)greaterthan5andlessthan10.selectc.cli_nomefromclientec,pedidop,itemi,produtoprwherec.cli_codigo=p.cli_codigoan...
asked by 12.11.2015 / 20:44
1
answer

List friends posts

I have a database with the following structure: Users table: usuario_id Primária int(11) nome varchar(128) nascimento date Friendships table: id_amizade Primária int(11) id_remenente...
asked by 01.01.2016 / 13:22
1
answer

How to perform JOIN where the identifier could not be associated

I have the following query ready on an old system: SELECT regional, r.cod_gerente AS cod_gerente, u2.username AS nome_gerente, s.COD_REPRESENTANTE AS cod_representante, u1.username AS nome_representante, SUM(s.jan_valor) AS...
asked by 23.11.2015 / 21:32
1
answer

SQL Query returning duplicate records

I have a BIG problem in a SELECT: I have two Tables' adwords_performance 'and' analytics_transaction 'and I need to do a SELECT by adding columns' adwords_performance.clicks ', '< strong> adwords_performance.impressions 'and' analytics...
asked by 19.03.2015 / 21:16
1
answer

Error: Multi-part identifier could not be associated

I'm trying to run the following command: SELECT * FROM pendencia, cliente LEFT JOIN servico ON pendencia.id_pendencia = servico.id_pendencia LEFT JOIN cidade ON cliente.id_cidade = cidade.id_cidade WHERE cliente.id_cliente = pendencia.id_clie...
asked by 26.11.2014 / 19:33
3
answers

Filter table before applying a LEFT JOIN

I have two tables and I want all elements of the first one - regardless of the JOIN condition (which characterizes a LEFT JOIN) - but before that I want to filter the second table. For example: Client table: ╔══════════╦═══════╗ ║ C...
asked by 19.02.2014 / 20:48
2
answers

update sql relating a column with external value

Good morning, I'm having a hard time doing an SQL Server update. I have the following situation: Table 1 ID Codigo Table 2 ID Nome And I have an excel file like this: Excel Codigo Nome I need to update the Name colum...
asked by 25.09.2018 / 14:40
1
answer

INSERT WITH TWO TABLES - PHP

I have the student table and the payments table, I'm doing a gym system. I have listed the two tables by putting student_id in the payments table as a foreign key. I want you to enter the data together of these two tables on the screen wh...
asked by 24.09.2018 / 17:10
1
answer

Get value from the right set with 'ambiguous' fields

I'm doing the following query to my database: $escalacoes = 'SELECT * FROM escalacoes AS e JOIN jogador_rodada AS jr ON e.id_jogador = jr.id_jogador WHERE e.rodada = ('.$rodada_atual.' - 0) AND jr.rodada = '.$rodada_atual; $escalacoes...
asked by 08.07.2018 / 00:42
1
answer

C # Lambda with 2 tables

I have the statement below, in C #, and would like to include an existing information in another table, such as the apartment column (existing in the condomino table). return GetUltraGeneric<Usuario>().Where(p => p.condominio == Const...
asked by 03.06.2018 / 03:38