Questions tagged as 'sql'

1
answer

How to do 1 only query and distribute the result spread by the code?

Well, I have a site where I am in each area using a select, so I think I'm doing more queries than I should, is there any way to get the result done? follows an image of what I'm proposing <?phptry{$sql="SELECT * FROM anuncios ORDER BY RA...
asked by 02.03.2016 / 19:15
2
answers

How to create a trigger to save updates of two tables?

I have two tables: table1 : with three columns product_id , product_name , product_price ; table2 : with four columns tag_name , product_id , tag_name , tag_name li> I've created a new table3 : with three columns product_id ,...
asked by 16.12.2016 / 12:46
1
answer

Help with SQL Query MySql

I need to select All messages sent by user 1 to user 2 and to know of messages sent from user 2 to user 1. I am not able to mount the SQL query for the described situation. Message table: IdMsg, IdUserFrom, IdUSerTo, Data, Mensagem Sql t...
asked by 14.12.2016 / 23:46
1
answer

Doubt with query in SQL Server

I have the following query in SQL Server, to return me a list of cities that I need. select IDCidade as "ID", case UF when 'RS' then '1' when 'SC' then '2' when 'PR' then '3' when 'SP' then '4' when 'RJ' the...
asked by 13.12.2016 / 14:32
1
answer

How to treat data from a Date lookup in the where clause in Postgres?

I have a screen where you have a list of payment titles for a company, and I need to do a dynamic search from the issue date of the title. The idea is that when the user enters the date in a search field, this data will be passed dynamically via...
asked by 23.10.2015 / 15:05
1
answer

JPQL Query - SQL

Good evening. I have a bean, which has an init () method. One of the goals of this init is to bring the cycle that was opened according to the course of that user, ie If there is no cycle or evaluation process involved with the course of that...
asked by 31.10.2015 / 03:27
2
answers

Is it possible to use between to filter searches with a character type field?

For example, if I am to search the database for a table with the price of the products, I use it in my condition where: preco_produto between 10 and 550 but and for me to do the same type of search in a column of character type? Because when try...
asked by 15.10.2015 / 21:39
3
answers

Return a sql command in a function

I wonder if it is possible to return a sql command on a function to run as a subselect. For example: Select *, produtos = (nome_da_function()) from Usuario Well, the way I did it, I was only able to return as a string inside a column....
asked by 20.10.2015 / 17:40
1
answer

Questions for app development with swift [closed]

I'm working with an app for iOS and I'm using Swift. My client who owns a restaurant would like to use an admin panel to add new dishes to the app. I would like to know if there is a panel on the net that already does something like this or i...
asked by 15.10.2015 / 04:23
1
answer

SQL / JPQL Query

Friends, good afternoon. I have a table in the database called Questao Inside the table I have two columns that are ID and Question . I have a filter that I can not specifically bring only code and asks because the method return is an ob...
asked by 13.10.2015 / 21:06