Questions tagged as 'sql'

1
answer

ORA-00907: missing right parenthesis error

I have a select within my query used for sum and every time I add the GRADE field of table PA_XCPNT_EVTHST.GRADE, I get the error ORA-00907. If I remove the select grid, it works perfectly. This is the original select: ( SELECT SUM( SCORE ) FR...
asked by 08.01.2018 / 18:16
1
answer

SQLQuery - Some Duplicate Records

Galera, in the query below is bringing as follows. UsuID Consultor Tentativa 1 Abertos 95093 Gabriela 96 However, it is meant to bring the following: UsuID Consultor Tentativa 2 Abertos 95093 Gabriela 48...
asked by 08.01.2018 / 18:27
2
answers

Group php mysql overdue invoices

Hello, I'm a beginner, I'm learning to do select, and I would like to receive help from this wonderful community. I need to pick up only the invoices that are with the a_vencer status of each student, it would more or less group by id the inv...
asked by 08.01.2018 / 18:27
9
answers

How to prevent SQL injection in my PHP code?

I developed a page in PHP for internal use of the company I work with and only very few people use it. You can use this page to do some queries, insertions, changes and deletions of a table in a MySQL database, however I believe that my PHP code...
asked by 03.02.2014 / 13:37
0
answers

Change varchar data type to int

Is there any problem in changing the data type from varchar to int in mysql? I have a spreadsheet with some items that have been entered as varchar, all are numbers. The problem is that I need to do a bigger and smaller search, however, as it is...
asked by 03.01.2018 / 13:52
2
answers

Error 102 in OpenQuery

I'm having this error:    Incorrect syntax next to '@SQL_LINKED'. Error 102. SQLSTATE 42000.   Severity 15. MsgState 1. Line 78. When trying to run this script: SET @SQL_LINKED = 'SELECT CAST(v.produto AS VARCHAR(20)) AS CAIXA, v....
asked by 03.01.2018 / 03:37
0
answers

Sum of hours obtained through a query in mysql

SELECT TIMEDIFF( atendimento_ticket.close_atendimento, atendimento_ticket.open_atendimento ) AS duracao FROM atendimento_ticket WHERE id_tec = '$id_tec'     
asked by 27.12.2017 / 20:53
2
answers

Generate random name in MySQL - Stored Procedure

Good evening, is there any way to generate random names with stored procedures in MySQL? I have the following table:    ALUNO (id: int [PK], name (varchar (100)), age: int, Cr (float)) I need this table with 10mil entries popular. To gene...
asked by 20.05.2016 / 03:23
1
answer

Select the value of a field depending on a date

I have a table with the fields DT_FIMCALCULO, VL_DEPREREVVIDAUTILACUMULADA and CD_SEQUENCIALBEM. And for each CD_SEQUENCIALBEM I have several DT_FIMCALCULO each with a different VL_DEPREREVVIDAUTILACUMULADA. I want to select the VL_DEPREREVVI...
asked by 19.12.2017 / 13:19
0
answers

Record in table if query returns result (Oracle)

I'm developing a call panel. I have a query that results in the client's call (name / password / guiche), this query returns the result for 10 seconds, after that it is empty until the next call. I need every time this query has content (numr...
asked by 19.12.2017 / 11:51