Questions tagged as 'sql'

0
answers

Copy a record from a database with several related tables

I am trying to copy a record from a database table database, but the problem is that this table has many foreign key bindings. The record should involve some 40 tables. Is there any way I can do this? I just need to duplicate the registry by cha...
asked by 05.02.2016 / 18:55
1
answer

SQL query according to Column make a new one

I have a column that is numeric. There are positive and negative values in this column. I need to make a query that when it is positive, I query Tabela A , when it is negative I refer to Tabela B . I have no idea how to do this, can...
asked by 11.12.2015 / 14:40
0
answers

Error in SQL code subquery

My error is as follows    Warning: mysql_fetch_array () expects parameter 1 to be resource,   boolean given in C: \ xampp \ htdocs \ project \ BD \ proj_detalhes.php on line   25 <?php $base_dados = "crowdfunding"; $conexao = mysql_conn...
asked by 04.12.2015 / 23:18
1
answer

Group function does not work

I have two tables. Table: Pedido Columns: IDPEDIDO , CLIENTE , DT_PEDIDO , FORMA_PGMT , CLIENTE_ID . Table: Itens_Pedido Columns: PEDIDO_ID , QT_MERCADORIAS , MERCADORI...
asked by 05.12.2015 / 20:22
1
answer

Vertex closer to other - Postgis

Is it possible to return the vertex closer to another? Being that one of the observed geometries is a linestring. As in the figure below: I want to return the single vertex of the linestring (which is represented by the black dots) that...
asked by 18.11.2015 / 15:09
1
answer

Error: 'Operand type clash: image is incompatible with numeric'

When trying to save an object in the database, it gives the following exception:    org.hibernate.exception.DataException: could not update. [...] Caused by: java.sql.SQLException: Operand type clash: image is incompatible with numeric. I...
asked by 18.11.2015 / 12:19
1
answer

Correct where clause with like null operator that finds data with nulls parameters

I have a query that is taking the null fields with the like operator. Let's look at an example in the query below: $palavraChave = null; $consulta = "select * from receitas where receita like '%$palavraChave%' "; Note that if I set...
asked by 07.11.2015 / 14:31
1
answer

SqlUpdate does not change data in the database [duplicate]

Note: Many people could not solve this question and they marked my question as wrongly duplicated because of an answer in another question similar to this but the answer does not help me at all . > I'm developing software for a MVC (Model-v...
asked by 27.10.2015 / 19:43
1
answer

Query Performance - Postgresql

I have the following situation, I need to bring data from a vehicle table of the system in which I work and another with integrated data of a partner system, because integration is not very consistent data and the way to connect the tables can b...
asked by 29.10.2015 / 12:21
1
answer

Like does not return data

I have a function in mysql that returns a decimal value. In this function has a like. When I test the sql in mysql the value is returned if I enter a letter or more than one. Ex: LIKE 'House%'. As for the sql that is in a method of a class o...
asked by 29.10.2015 / 02:15