Questions tagged as 'mysql'

1
answer

How to select partially distinct lines?

I have a table whose column reference contains values constructed as follows:    Reference / Color / Size / Gender Examples: JOHN/WHITE/52/MALE JOHN/WHITE/51/FEMALE JOHN/BLACK/52/MALE JOHN/BLACK/51/FEMALE JANE/BLACK/XL/MALE JANE/...
asked by 06.01.2014 / 21:35
1
answer

How can I detect and warn that a certain user is sending many messages in a row?

In a chat room, how can I detect and warn that a certain system user is sending lots of messages in a row?     
asked by 17.12.2013 / 05:48
2
answers

How to invert values that are separated by commas in mysql

Photo from my base: Thedatalookslikethis:-46.63642120299626,-23.54854965191239,0Ineedtoselecttobeinverted:Ex:-23.54854965191239,0,-46.63642120299626Myselectioninphp:<?php$query=mysql_query("SELECT * FROM tabela")or die(mysql_error()); whi...
asked by 28.09.2015 / 17:35
2
answers

How to sum values from a grouped field by date?

SELECT funcionario_id, data, avaliacao_postura FROM equipe id funcionario_id data avaliacao_postura 1 1 2014-03-02 -25;-10;-5;-12 2 1 2014-03-01 -25;-10;-18...
asked by 10.04.2014 / 00:43
1
answer

How to insert data into two tables at the same time?

I need to do an insert as follows: I have two tables TABELA 1 and TABELA 2 and a form of cadatro. This form has three inputs: input 1, input 2, input 3 input 1 must be entered in TABELA 1 . input 2 e in...
asked by 12.03.2015 / 16:15
1
answer

How to mount a WebService to synchronize SQLite database of Android and MySQL

I've set up an android app that stores basic information about a contact in SQLite:
asked by 18.08.2015 / 03:16
1
answer

Modeling with Code First so you can change databases

If I generate my database for MySQL using the concept of Code First can I change it to SQL Server in the future? Do you need to change the classes or just the config and provider ?     
asked by 17.04.2017 / 15:27
1
answer

MySQL - What types of data should be enclosed in quotation marks?

I'm developing a script for backup / dump from my database via PHP , but when saving the file, I need to put quotation marks according to type of the column. So far so good! But what data types should be enclosed in quotation marks? Exam...
asked by 27.04.2017 / 20:26
1
answer

How to simulate the LEAD and LAG functions? [MySQL]

I have recently been developing a query in which I had the need to compare successively the rows of the same data set , I mean, from the same column, from the same table. In this, I became aware of the MySQL LEAD () and LAG () functions. Howeve...
asked by 23.11.2018 / 18:09
1
answer

What is a client-side prepared statement?

I am starting to develop a page using PHP and, as I am still learning the language, I decided to find which module to use to connect to a MySQL database. From this answer , I discovered that the mysql_* module has already been depreca...
asked by 01.02.2014 / 15:12