Questions tagged as 'sql'

1
answer

SET ENABLE_BROKER taking too long to execute

I ran the command ALTER DATABASE [Banco] SET ENABLE_BROKER; but it has been running for more than 20 minutes and counting. Would you have a faster way to do it?     
asked by 10.03.2017 / 13:19
1
answer

To display the day of the week of any date in the last 1,000 years

I used this command select to_char(to_date('18-apr-1972','dd-mon-yyyy'),'day') day from DUAL; but gave execution error: ORA-01841: ano (completo) deve estar entre -4713 e +9999 e não pode ser zero 01841. 00000 - "(full) year must be betw...
asked by 28.12.2016 / 22:37
1
answer

Removing "BC" from Timestamp dates in Postgresql

Hello, I'm trying to remove the "BC" from sql dates but I'm not getting it. I do the following: SELECT CAST("regiaulaavul_dataInicio" AS date) FROM "RegistroAulaAvulsa" And it turns out to return the date with a BC (Before Christ) in fron...
asked by 26.01.2017 / 13:06
2
answers

How to compare 2 Cells in different columns - SQL

I need to make a SELECT looking for some data with the proviso that only if the value of a certain cell is different from another cell . Ex: +-----------+------+------+ | Descricao | Val1 | Val2 | +-----------+------+---...
asked by 25.01.2017 / 20:38
2
answers

Updating large amount of data in mysql

I have a MyISAM table with more than 200,000 records. From time to time I need to make a general update on the content. I create a new table and import ALL postings to the 'second' table in phpMyAdmin . So far so good. After that...
asked by 28.11.2016 / 16:39
1
answer

Problems with Query Builder in Laravel 4.2

Hello, I am having trouble generating a query using the Query Builder of Laravel 4.2 , the difficulty arises from the need for resulting queries in the database to be inside of parentheses, below is the desired query: select * from 'EV_R...
asked by 05.12.2016 / 20:12
2
answers

Is it possible, in MySQL, to update column information on multiple duplicate rows, leaving only one row with the original value?

For example, I have several rows in a table (which I pulled from an XML of google products, so the same product is presented several times, each for a clothing / product size) that are referenced for the same item, only with product size differe...
asked by 02.12.2016 / 19:11
1
answer

Create a query by checking two columns

I have a following table: tbl_missao id_misssao hostname status war_id commit_server_id When you create a mission, it can add that mission to itself or you can tell another user (warrior) to perform this mission. The logic is a...
asked by 05.12.2016 / 17:52
2
answers

Problem when performing join on tables with generalization

I'm having trouble performing a JOIN on tables so the problem is this: In a bulletin board system, I have users, including students, school officials, and school employees. I need to generate an SQL statement that, when informing the CPF of t...
asked by 23.12.2016 / 03:33
2
answers

Return something in the query when there are no records

I'm making adjustments to a graphics system, basically there is a query in the database to bring values and popular the chart, but when there is no specific record does not return anything from the database and the graph breaks. I would like...
asked by 23.01.2017 / 18:30