Questions tagged as 'sql'

1
answer

MySQL update event

I asked this question yesterday, I got the answer I wanted, I'll be direct and challenge: I have the query: UPDATE users SET time = time - 1 time is of type int and receives as default value 0 , in my PHP code I mad...
asked by 03.08.2017 / 07:35
1
answer

Is it possible to group a range of values?

I made the following query: 'select t.net, t.hora, t.'data', t.'local' from domingos t join( select net, updated, count(*) from domingos where 'data' = '07/05/2017' group by updated, net having count(*) > 4 ) as u on t.updated = u.updated a...
asked by 31.07.2017 / 19:46
2
answers

Remove duplicate data and return the highest value date field

We're migrating signatures from an Access database to Mysql, but before migrating I need to treat some parts of the data. I need: Remove duplicate id's Return the highest value of the date field for these id's In the librecalc itself it...
asked by 05.07.2016 / 21:03
2
answers

How to create summation with "sum" with multiple columns queryover

I need to create a query with C # queryOver (Nhibernate), to add more than one column. Example in pure sql: SELECT SUM(coluna1 + coluna2 + coluna3 + coluna4) FROM tabela First I did it this way: Tabela tabela = null; Session.QueryOver<...
asked by 05.07.2016 / 21:39
1
answer

Dynamic access oracle cursor column

I have a situation where I need to access the attributes of a cursor differently. I have a cursor that returns me a list of records, with columns like col_1, col_nova, col_teste (illustrative names). I loop this cursor to fit a return string....
asked by 06.07.2016 / 21:22
1
answer

search product / property with autocomplete and populate content dynamically with php and mysql

I'm developing a quick search field with autocomplete of jquery ui, php and mysql. The autocomplete works perfectly though, I'd like to do it another way. When the user starts typing in the field the display window is filled with real estate rel...
asked by 26.08.2015 / 19:24
2
answers

Sort field or date expired notifications, database

I do not know about database, I'm using one in Visual Studio (the default SQL called "Services-based Database"), I already integrated it into the form and made up the query fields. But it has a field of one of the tables that would be dated,...
asked by 30.06.2015 / 20:06
1
answer

Return tags associated with posts

I use the query below to return all posts tagged with the tag defined: SELECT imprensa_posts.slug AS slug, tipo, titulo, data FROM imprensa_posts JOIN imprensa_tags_posts ON imprensa_tags_posts.id_post = imprensa_posts.id_post JOIN imprensa_...
asked by 10.06.2015 / 20:55
1
answer

SQL: Can I have clauses in GroupBy that do not appear in Select?

I know that I can not have clauses in the select that do not appear in Group By. But is it possible otherwise? For example: Select B From Table Group By A,B     
asked by 10.05.2015 / 03:36
1
answer

List tables by foreign key in MySQL

How to identify tables that relate to one another, that is, tables that have a foreign key that references another table? As the dummy example, I need a statement that shows the list of tables linked to the product table as output, in this...
asked by 21.03.2015 / 02:33