Questions tagged as 'sql'

1
answer

Write on a label when it loads with the form

Well, I have a program that requires me to write using labels, but these only work, and actually write when they are clicked, I would like someone to explain how I should proceed to be able to write then the form is loaded : EDIT: Basically a...
asked by 20.07.2015 / 16:44
2
answers

How to check if a table exists in SQL Server 2005 database and if it does not exist create it and the columns

How to check if a table exists in the SQL Server 2005 database, and if it does not exist, create it and the columns. The purpose of this process and create this routine for when I need to create a new field in my application, I put it inside thi...
asked by 05.05.2016 / 23:44
2
answers

Create total sales procedure (value) per customer

I need to make a procedure that instantiates the cli_TotalCompras column of the client table with the customer's total (in value). In the vendaProduto table I have the value ( vpr_ValorUnit ), the quantity ( vpr...
asked by 26.10.2016 / 00:22
5
answers

Group records per day

I have the following table ID | Início | Fim | Horas 333 | 01/01/2017 | 03/01/2017 | 5 333 | 02/01/2017 | 05/01/2017 | 1 333 | 05/01/2017 | 07/01/2017 | 3 333 | 01/01/2017 | 07/01/2017 | 6 I need a result like this...
asked by 12.01.2017 / 17:39
2
answers

Sequential numbering of the results of a query

I'm not very close to the database, and in fact I do not even need such functionality, but just for the sake of curiosity, it's possible to create in runtime , that is, during SELECT , a sequential numbering to be used in substitution of the au...
asked by 13.12.2014 / 18:07
2
answers

How to create a MySQL database with SQL commands?

I would like to know how to create a database in MySQL using SQL commands, which I can run in MySQL Workbench, phpMyAdmin or any other software. What SQL commands do I need to create a database and its tables?     
asked by 17.05.2016 / 21:27
5
answers

How do I get the name and attributes of tables from a MySQL database?

How to get the names of all MySQL tables ? How to get the attributes (name, type, etc ...) of a given table in the MySQL database?     
asked by 11.12.2013 / 18:08
4
answers

Concatenate 2 PHP variables in SQL statement

I am developing a PHP system with Oracle and to "optimize" an update, I would need to concatenate a variable (with values from 1 to 3) in the name of the variable I will pass in the statement. The variables come from a form, and I need to pass t...
asked by 09.09.2016 / 19:01
2
answers

Query DELETE too slow to load

I'm having a problem with a query, it has the function of deleting some existing duplicate records in a table. Follows: DELETE t1 FROM bid_account t1 INNER JOIN bid_account t2 WHERE t1.id > t2.id AND t1.bidding_price = t2.bid...
asked by 11.04.2018 / 06:47
2
answers

MySQL - Select between 2 tables with field "String"

I would like to know how to do a Select to return non-existent records by comparing two tables with the String field. Example: Tabelas Campo1 Campo2 Tab1 Nome Tel Tab2 Nome email The result of the comparison (the select)...
asked by 26.07.2018 / 16:36