Questions tagged as 'sql'

1
answer

# 1115 - Unknown character set: 'utf8mb4' [closed]

When migrating the MAMP database to the server Are you giving me this error? Can you help me? Error SQL command: /*!40101 SET NAMES utf8mb4 */; MySQL Message:    #1115 - Unknown character set: 'utf8mb4'     
asked by 20.12.2016 / 15:06
1
answer

Problem in performing a Java language INSERT

Hello everyone, I have a problem that I think should be very easy but as I am new to it, it is not rs, I have an insert to perform in a class called ClienteDAO follow the code below: public class clienteDAO { public void Create(clie...
asked by 23.12.2016 / 20:03
1
answer

Currency Format

To be complete could not enter with a FORMAT (Value, 2) even in CONCAT? SELECT * , CONCAT('de ', Valor, ' por ', desconto) AS promocao FROM (SELECT Valor, Valor - Valor * 20/100 AS desconto FROM comissao ORDER BY comissao.Valor DESC) t;...
asked by 07.12.2016 / 02:14
1
answer

Query parameterized with node.js and knex.js

In the code below I make a query and fetch the contracts that are completed or not, according to the parameter concluido (0 or 1). How do I make this query bring all contracts when the value of the concluido parameter is not p...
asked by 07.12.2016 / 18:10
1
answer

Can you improve these 12 selections where only one parameter changes?

I have an online table with about 3 thousand records. I make twelve selects to list the results per month, eg: select count(campo) from tabela where extract(year from data) = 2016 and extract(month from data) = 1; select count(campo) from tabe...
asked by 26.10.2016 / 19:16
2
answers

How to delete all records from the database

Good afternoon, in my application has a database that shows the results of the game, I put a button that the function of it will delete all the data from the bank ... how do I do this part? in blogs I did not quite understand ... My get and s...
asked by 25.10.2016 / 18:35
1
answer

Difference between hours without taking into account the date

Good evening, I have the following code: WITH CONSULTA AS ( SELECT V.CHAPA, V.DATA, MAX(V.BATIDA) AS MAXBATIDA, MIN(V.BATIDA) AS MINBATIDA FROM ARELBATIDATRANSITOVIEW AS V...
asked by 25.10.2016 / 00:30
2
answers

How to delete the first 10 records of a table when it reaches a certain number of rows?

Good night, I have a table in SQL where I will put movie recommendations for the users, but I want it when it reaches a total of records in this table, it deletes the oldest records. My code looks like this: $sql = "INSERT INTO filmes_rec (...
asked by 12.10.2016 / 01:32
2
answers

Query to return specific values

In my table IDENTIFICACAO_PESSOA I have a column named IDENTIFICADOR . This column receives CPF values. However there are values there that do not correspond to CPF, that is, they are outside the standards of a CPF (999.999.999-99)....
asked by 02.03.2017 / 21:10
1
answer

make rows link in php

Good Night, I have a database and in it two columns, one of Links and the other of names, these links are for pages with more information about the movie, and the column name contains the names of the movies, well, I want my site to list the mov...
asked by 09.11.2016 / 00:18