Questions tagged as 'sql'

1
answer

Bring the first row based on a date in SQL

Another challenge stopped in my hands. I need help with my query. What I need: I want to know who the people who had account postings on a given day, where I need to display the value and status of that day. So, I have two tables, one...
asked by 28.02.2018 / 19:46
2
answers

Error with SQL and MariaDB (Current position is before the first row)

I have a problem with my database and I have no idea what it is. public String getBlockPermission(String blockstring){ String permission = ""; try{ ResultSet res = connection.createStatement().executeQuery("select permission fr...
asked by 06.01.2018 / 08:25
1
answer

Convert Data SQLServer

I would like to convert 02/01/2018 to 2018-01-02 00:00:00.000 , what I found on the internet so far was: select CONVERT (datetime, '02/01/2018', 120) That returns me 2018-02-01 00:00:00.000 , a little different than I ne...
asked by 02.01.2018 / 18:35
1
answer

Return the value to the left

Good morning. A question, how can I return the results of a column containing only the left values that start with the word 'car' for example? I'm using the sql server. Thank you.     
asked by 12.06.2018 / 15:25
1
answer

Problem when trying to query with PHP and MYSQL

I'm trying to do a query directly in the PHP file where it creates the connection to the database. This query will create my table. The problem is that I am trying to reference the connection variable in mysqli_query () and it is not being...
asked by 04.01.2018 / 19:52
1
answer

Generate script with insert of tables in sql server

I use Sql Server 2012. I made a query with the title above and did not bring anything in the search. I have a BD and I need to take you somewhere else. So, the best way is to generate a script of all the existing objects in it and since I have p...
asked by 11.12.2017 / 20:02
2
answers

Query on all tables in the database

Is it possible to query all tables with the same column for their values? For example, I have the Bank named SGE , I have 230 tables in it, all these tables have the CodPRF column and I want Query to return all the results in th...
asked by 04.12.2017 / 18:50
2
answers

How to do Sub Select in SQL

I would like to know if anyone can help me because I could not do the sub select command between two tables, could anyone help me? I need to pull the name of the book that is in the book table together with the data in the sales table. Tab...
asked by 27.08.2018 / 21:11
1
answer

Error The multi-part identifier "..." could not be bound

I'm trying to do the following select and it returns me the error The multi-part identifier "..." could not be bound in ImportaContratoAux.ContratoId select AreaReclamacao.Descricao from AreaReclamacao inner join Contrato on Contrato.Id = Imp...
asked by 25.04.2018 / 19:49
1
answer

How to group results of a query?

I have the following query that brings the name of the recipe and the ingredients: $query = (" SELECT r.receita, i.ingrediente FROM ptp_receitas r, ptp_receitas_ingredientes ri, ptp_ingredientes i WHERE r.id = ri.idreceita AND ri.idingrediente...
asked by 12.04.2018 / 22:31