Questions tagged as 'sql'

1
answer

Delete record when the date of a column is reached

I have the tables: In%with%Ihavecolumnanunciosthatreceivesthenumberofdaysthatthatadisvalid,Iwanteverydaythatpassesthedatabasetoautomaticallydecreaseexpiracaointhatcolumn,inacountdowntodeactivatetheannouncement.Andwhenitreaches0,itcreatesarec...
asked by 12.05.2016 / 19:06
3
answers

Query Result on another page

I would like to know how I can get the result of a query on a page of mine, fill a tag on another page; Example: I have a search page the amount of existing processes, when I click the button, let's assume that it returns m...
asked by 24.02.2016 / 18:06
1
answer

Procedure to delete and then insert data

Could someone guide me on how to construct a procedure to delete data from a table (already created with SELECT INTO), every day such an hour and then soon fill it again. Thanks in advance for your attention.     
asked by 13.03.2016 / 17:16
1
answer

INNER JOIN 3 tables with pivot table

Part of my database consists of these three tables. And I'm trying to get to a SQL query that tells me the clients by sellers, ie for example: John sellers sells for 4 stores (street y, street x, street j, street z) in which each one of th...
asked by 12.02.2016 / 19:54
1
answer

SQL data counts filtered by multiple tables

I have a page in PHP where I have to generate a chart of "Registered sellers" filtered by region. The problem is that the Sellers table has City Id, the City table has the State Id, and the State Id has the Id. And I need to filter the selle...
asked by 14.04.2016 / 22:34
1
answer

How to leave search field prepared to search for any term

I have a register of textures where the code of the same is composed of numbers and sometimes with letters, for example: Código: 2564 Código: C-6551 I would like to leave the search field ready to search for any term searched by the user, s...
asked by 07.03.2016 / 13:12
1
answer

Trigger execute update after the procedure has been executed

I would like to know how I do in SQL Server for a trigger check if the procedure was executed and if it was executed, this trigger will do another update. Thanks in advance for your attention. Att, Marcilio     
asked by 30.03.2016 / 19:46
1
answer

List AD groups through a query

I want to do a direct query to Adctive Directory. I need to know which groups Views are linked to, the same goes for users. The structure, for neighbors to understand better: a group is created where a view is bound, for that group of the vie...
asked by 21.01.2016 / 14:37
1
answer

Identify and archive old MySql records

I'm working on a project using database as MySql where some areas will be constantly fed generating a large number of records in a short time, as is the case of an area for maintenance tickets. However, this data becomes obsolete as quick...
asked by 30.05.2016 / 02:38
1
answer

Mysqli Prepare with loop for Select

I am trying to make a SELECT using MySQLi and PREPARE in FOR but not working. It is always returning a single zero. Application code: if( $teste = $mysqli->prepare("SELECT COUNT(*) AS TOTAL_CONTATOS, 'data' AS...
asked by 13.01.2016 / 16:34