Questions tagged as 'sql'

2
answers

SQL QUERY get a month's average of a relative day of the week

I need a query that returns me the average of a relative month, and a day of the week. For example: I need to know the components for the month of February, the day of the week Monday. It is possible to define some expression for DATA ,...
asked by 02.04.2014 / 14:05
2
answers

How to Migrate SQL Server Database to Oracle

I've created a diagram in sql-server , where it automatically creates the entire database structure, but I will have to migrate to Oracle. Can I migrate the entire structure (tables, FKs, PKs, etc.) with some tool? Obs. 1: There are no d...
asked by 01.04.2014 / 15:41
1
answer

Rewrite the code to display expected result?

This code should return all records in the property table if the array is empty and return selected records if there are items in the array. I can get the array to be mounted and the database queried if I select at least one form item but I...
asked by 07.10.2014 / 04:28
2
answers

Query with date range with a variable

I'm new to SQL and I'm breaking my head to put together a query that returns the results I want. I have a field whose date format is as follows: 2018-12-13T18:01:16.573-02:00 . I have a $Período variable whose values are (mont...
asked by 19.12.2018 / 21:28
1
answer

SELECT DISTINCT in column of type JSON in postgresql

I have a table that has 2 columns, id (int auto_increment) and resp (json). In this table I have duplicate values in the resp column, something like this: id | resp -------------------------------------------- 1 | {"nome": "Jonh Doe...
asked by 20.12.2018 / 12:30
1
answer

Oracle migration to sql server

Can someone tell me a good data migration tool for the oracle database for the sql server database and vice versa?  I need to get lots of records from the oracle database and save it to the sql server database, I need the migration to be done in...
asked by 12.12.2018 / 19:28
1
answer

Join two Select

I am developing a report in PowerBuilder and would like to know how to merge results from two SQL queries into the report. If I add the function f_block_to_number in the first query and add the invoice table in from, the records multiply in the...
asked by 20.05.2014 / 18:36
1
answer

Using Count with select all

I want to make a sql by counting the records with duplicity: select produto,matricula,data,fornecedor, count(*) from tb_teste group by produto,matricula order by fornecedor In this form of the error, sql requests the fields data,forn...
asked by 14.12.2018 / 18:33
1
answer

How to escape quotes from a json key in Postgresql?

I have a function that receives JSON's, it happens that the user can put it like this: Normal : '[{"nome":"João Carlos"}, {"nome":"Maria Silva"}]' Problem : '[{"nome":"João - "Carlos" - "}, {"nome":"Maria Silva"}]' Note that it is...
asked by 26.11.2018 / 16:54
1
answer

While always returns the last record in sql server

I have a select to bring all the records that have been entered and I need to do a while to cycle through this select and give an insert in another temporary table. Only while is always bringing the last record What could be wrong?...
asked by 28.11.2018 / 13:14