Posts by Hugo Rutemberg • 307 points
21 posts
-
1
votes2
answers36
viewsA: Select separate data from two tables excluding repeated ones
I was able to solve with the following query: There was no need to create a relationship between the two tables. I selected the two tables individually and then used UNION to join the data excluding…
sqlanswered Hugo Rutemberg 307 -
1
votes2
answers36
viewsQ: Select separate data from two tables excluding repeated ones
How could I select in two tables bringing the column data SKU of both tables even if the data of one table does not exist in the other table, also need to delete the repeated data. These are the…
sqlasked Hugo Rutemberg 307 -
1
votes3
answers1052
viewsA: How to select different records between two tables
I solved with the following code select * from item_inventarios where cod_coletor not in (select cod_coletor from funcionarios) and `id_inventario`='85'
-
1
votes3
answers1052
viewsQ: How to select different records between two tables
How to select different records between two tables I tried to run the query with the query below; but it did not generate records; SELECT c1.cod_coletor, c2.cod_coletor FROM item_inventarios c1…
-
0
votes1
answer129
viewsQ: PHP - Merge array with PHP multidirectional array
How to join arrays with a multidimensional array: Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => Array ( [cod_setor] => 1 ) [6] => Array ( [cod_setor] => 2 )…
-
0
votes0
answers264
viewsQ: SQL, List number numbers that are not in the table sequence
How could I list numbers that are missing to complete the sequence of numbers given column of my table? see the link to view my test base: http://sqlfiddle.com/#! 9/d124553/1 See below my select to…
-
0
votes1
answer33
viewsA: Error using Between with codeigniter
Problem solved with the code below; public function listar_arquivo_saida($id) { return $this->db->select("ii.sku,ii.cod_setor,ia.setor_ini,ia.setor_fim,sum(ii.quantidade) as…
-
0
votes1
answer33
viewsQ: Error using Between with codeigniter
How to create a function SELECT ii.sku, ii.cod_setor, ia.setor_ini, ia.setor_fim, sum(ii.quantidade) as quantidades, ia.desc_ambiente, ii.cod_coletor FROM item_inventarios ii inner join…
-
0
votes1
answer73
viewsQ: Relationship of two MYSQLI tables
I’m trying to link two tables so the result looks like this; Address for test of the query http://sqlfiddle.com/#! 9/d9acad/1 I tried to use the command below; SELECT item_inventarios.sku,…
sqlasked Hugo Rutemberg 307 -
0
votes2
answers598
viewsA: Remove QUOTES when generating TXT file using PHP
I solved the problem with the following code fputcsv ($file,$line,"\n","\r"); source: https://www.php.net/manual/en/function.fputcsv.php…
-
2
votes2
answers598
viewsQ: Remove QUOTES when generating TXT file using PHP
How to remove "double quotes" in TXT file extracted from mysqli with PHP. PHP function to create file // Export data in CSV format public function exportCSV(){ $id = $this->input->get("id");…
-
0
votes2
answers218
viewsA: Inner Join with subselect codeigniter
I managed to solve with the code below; //campos do select $this->db->select('AC.cod_setor, AC.cod_coletor, SUM(ac.quantidade) AS quantidade'); // tabela from…
-
0
votes2
answers218
viewsQ: Inner Join with subselect codeigniter
How to create a function that brings the same query result below using codeigniter? SELECT AC.cod_setor,AC.cod_coletor ,SUM(ac.quantidade) AS quantidade FROM item_inventarios AC INNER JOIN ( SELECT…
-
2
votes3
answers202
viewsQ: Sql query bring repeated result
How do I list only the sector column that has repeated data? in case, just show the sector 150 SELECT setor,count(quantidade) as quantidade, usuario FROM arquivo_coletor GROUP BY setor,usuario ORDER…
-
1
votes1
answer90
viewsQ: PHP - Bring result with select decimals in the Firebird database
How to bring the decimals (.00) back from my array after the database query using PHP? See the result of the consultation; array(2) { ["COD_PRODUTO"]=>string(9) "AM0038784"…
-
6
votes3
answers237
viewsQ: Query SQL Add duplicate value
When running the SQL query I get the following result; However, I would like to receive the result as follows; Executed SQL query; SELECT CODIGO_BARRAS.barra, produtos_eventos.quantidade FROM…
sqlasked Hugo Rutemberg 307 -
1
votes1
answer116
viewsA: PHP+FIREBIRD - Bring table relations result
I managed to solve the problem by adding the table fields that I want to bring the results. The code went like this; //Instruções SQL $sql = " SELECT **FUNCIONARIOS.NOME, FILIAIS.CNPJ,…
-
0
votes1
answer116
viewsQ: PHP+FIREBIRD - Bring table relations result
In Ibexpert the query below brings the data that correctly, but when I use the same query in PHP does not work. SELECT FUNCIONARIOS.nome, CNPJ, cod_funcionario, LOGRADOURO, CONTATO, cidade, estado,…
-
1
votes1
answer846
viewsA: Select in Firebird with PHP using conditions
found the solution the solution. //Instruções SQL $sql = "SELECT * FROM ESTOQUES,CODIGO_BARRAS WHERE CODIGO_BARRAS.PRODUTO=ESTOQUES.PRODUTO AND CODIGO_BARRAS.COR=ESTOQUES.COR AND…
-
1
votes1
answer846
viewsQ: Select in Firebird with PHP using conditions
How do I correctly include select below in php code? I’m having a hard time doing WHERE. SELECT ESTOQUES.produto, ESTOQUES.cor, ESTOQUES.tamanho, ESTOQUES.filial, CODIGO_BARRAS.barra, ESTOQUES.saldo…
-
0
votes1
answer203
viewsQ: Send two txt fields via Soap using PHP
I need to get the values of two fields from a file in .txt and send via Soap. Sending Soap is already working, when I insert the Barcode and absoluteQuantity it sends the correct value, but now I…