Questions tagged as 'query'

2
answers

Paste mysql field dynamically

I created a select command based on information sent by the user, eg: $anoini = $_GET['anoini']; //variavel com ano escolhido pelo usuário $anofim = 2016; //ano final é 2016 $s = 'SELECT pa_proc_id, procedimento, '; //inicio da query while ($...
asked by 04.11.2016 / 19:39
1
answer

Display the Average in an SQL query

I want to perform a search on a query so far I have only been able to display the total value of the logs.  the idea is to show the average spending. Then it would be the (total / quantity) but I could not mount the logic: what I have so...
asked by 25.11.2015 / 13:52
1
answer

QUERY - Can anyone help me build this query?

I have these 3 tables below: "users", "friends" and "posts". I want to get all my friends who are in the friends table and display their posts, taking their name and their image (which are in the users table). Imagine a news feed, where I...
asked by 03.01.2017 / 13:11
1
answer

How to configure predicate to return only 2 columns?

Scenery: Do a query using CoreData looking for records with a city and state, and return only the 'name' and 'address' columns of the location. I'm currently using the following query: // Array to be returned NSMutableArray* arrayRegi...
asked by 11.10.2015 / 16:45
1
answer

How to capture a MySQL query from a given table in real time?

I want to capture queries that are sent to MySQL from a particular application, is it possible?     
asked by 22.10.2014 / 19:03
1
answer

How to list a sample of all tables in a MySQL database?

I need to sample all the tables in a MySQL database, for example through SELECT * ... LIMIT 10 . I already have the code that returns all the tables in the current database: select table_name from information_schema.tables where table...
asked by 26.09.2014 / 19:08
1
answer

Listing the most offending querys in MySQL

I would like to know which are the most offensive queries in my database. I have already used the conventional "Show full processlist" and other methods.     
asked by 25.07.2017 / 19:21
1
answer

Sending data from one table to another with the deleted command

I'm creating this trigger in SQL Server , but I'm not getting the id to send the data to another table and delete this table. CREATE TRIGGER MoveComprador ON comprador INSTEAD OF DELETE AS BEGIN SELECT * INTO bk_comprador FROM...
asked by 19.06.2015 / 06:31
1
answer

group_concat () from MySql on SqlServer

I created a table for example: I have the following content: select * from table_t; Youneedtogetthefollowingresult: In MySql I use the following query: select group_concat(concat_ws(' - ',id,descri)) id_descri, tipo from table_t grou...
asked by 27.04.2015 / 13:57
2
answers

Sort by day of the week, starting with today

I want to sort the results by the days of the week I have 7 events, 1 event for each day, and you have to sort it as follows:   Sunday, Monday, Tuesday, Wednesday , Thursday, Friday, Saturday Assuming that today is Wednesday it will ha...
asked by 15.02.2015 / 02:28