Questions tagged as 'sql'

1
answer

Percentage calculation in SQL SERVER

I have a little question that I can not solve, I searched the community here, but I did not find exactly what I wanted. My situation resembles the following: I have N product records in my database. And in these N records, I have only 3 diffe...
asked by 08.03.2016 / 17:55
2
answers

Generate Inserts from an already populated table

I have a populated table and need to generate the scripts of insert of the data stored in it, I can not export, it must be script of insert into ...  Doing with select concatenating is very laborious, since I h...
asked by 12.09.2017 / 22:15
2
answers

How to set up a SQL to display grouped content per month?

I need to set up a SQL to group information by month into columns formatted by Bootstrap. Come on: <div class="container"> <div class="row"> <div class="col-md-3"> <h2 class="eventos_mes">Maio<...
asked by 21.09.2015 / 14:30
2
answers

SQL - Searching for best-selling product in a date range

I'm trying to fetch the best-selling SQL product within a certain time period. For this, I have the table 'product_address', which has the following columns: id (PK) | account_id (FK) | product_id (FK) | precoFinal | created_at | updated_at...
asked by 07.03.2017 / 15:42
2
answers

Use mysql_fetch_assoc more than once

I have a big question about mysql_fetch_assoc in while. what happens is the following, I have a page where I do a database search and return for a while while the existing information with mysql_fetch_assoc, the problem is, when I want to do thi...
asked by 31.07.2014 / 23:57
3
answers

How to do a select with multiple results in a single row

The problem: One of our sites has a system of messages between users, for this we have two tables: one that stores messages between users and another with users, follow the structures below , and with this data we need to display in the messag...
asked by 03.07.2014 / 18:51
2
answers

Populate DataSet with DataTable

In C #, how do I declare and populate a DataSet with a DataTable? My idea is to pass the resulting data from a query in the Database to the DataSet, then fill a Report with that DataSet. Is it possible?     
asked by 10.10.2014 / 15:02
4
answers

Oracle11g - SELECT command problems

I have the following error:    java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly   ended This happens after I run the following line of SQL : /* Listar todas as reuniões do utilizador onde esteja convidado*/ St...
asked by 23.10.2014 / 12:03
2
answers

Update to clear entire column

I need to make a update in the bank where I clear 30,000 records, however I need to zero only the record of one of the columns. Example table: cd_product | ds_product | pr_product | dt_update This table contains the 30mil records an...
asked by 06.01.2015 / 12:30
1
answer

How to insert UUID automatically in a MySQL colum?

Is there any way to insert a UUID automatically into a table field, just as it does with a field of type AUTO_INCREMENT ? In a framework for PHP, CakePHP, when we set the primary key to VARCHAR(40) , it inserts a UUID...
asked by 25.02.2015 / 19:56