Questions tagged as 'mysql'

2
answers

Select with the day of the week in Portuguese

Good afternoon, I need to make a select that translates the day of the week into Portuguese, it's already working, but in English. How can I change? Select *,id, data, mes,date_format('data','%d/%m/%Y') as 'data_formatada' FROM (SELECT DAYNAME...
asked by 19.02.2016 / 16:25
4
answers

Data from a table A not contained in Table B

Following tables: Table: Users Id, Name Table: Card Id, UserID, Description I ask to know which users do not have a card: SELECT * FROM usuarios as u LEFT JOIN cartao as c ON c.IdUsuario != u.Id The result does not only ret...
asked by 13.07.2016 / 20:12
4
answers

How to perform query with some null values?

The SQL below returns the values correctly only if the data_emissao field is as not null in my DB table (regardless of whether the cliente parameter was passed or not), however I want to return the values where the data...
asked by 28.02.2017 / 22:00
6
answers

Hibernate is not creating the tables

I'm new to Hibernate, because of the little I've learned, I believe I did everything right, that is, I downloaded the dependencies, I wrote down the classes, etc. Below is my example class: package br.com.evolutionary.modelo; import javax.per...
asked by 12.05.2016 / 01:18
3
answers

How to do SELECT on more than one database table?

I have two tables in the database: zip and users. Can I make a single query to get fields from the two tables? Both have idCep. I want to get the address data from the cep table and the name and user of the users table. As I'm working with ph...
asked by 25.04.2016 / 20:31
4
answers

Return a sum in different rows in mysql

I have a table of deposit statements and withdrawals from some clients, as follows: id_cliente|operação|valor | ----------+--------+------+ 51298 | 01 | 50,00| ----------+--------+------+ 51298 | 01 | 48,50| ----------+--------...
asked by 05.05.2016 / 22:50
3
answers

Error: the right syntax to use near 'add

I do not know what's happening but my code does not work it is simply not inserting data into the table <?php include "../../lib/inc_con.php"; session_start(); $mesa = $_POST['mesa']; $tamanho = $_POST['tamanho']; $quantidade = $_POST['qtd'...
asked by 30.10.2015 / 05:45
2
answers

Prohibit duplicate emails in MySQL using PHP

My situation is as follows , I have a whole email marketing system in PHP and emails are added by .CSV file, however it is adding duplicate values and blank values. The problem is that , I have 1 table calls n_emails with 2 columns, on...
asked by 08.04.2016 / 13:47
2
answers

Is it possible to connect an application made in C to some database?

We usually use files to save data using C language (I at least). Is it possible to connect a relational database to some application made in C ? If so, do you need any library for this and how is that connection made? Preferably MySQL.     
asked by 21.09.2016 / 19:42
2
answers

Does MySql's Select command differentiate numbers that have zero left?

I have a table in MySql that has a field called Codigo , of type varchar(20) , this field in this case accepts codes that have zero on the left and codes that do not have zero on the left. Example: Códigos 0...
asked by 04.11.2016 / 19:23