Questions tagged as 'sql'

2
answers

What is the difference between COALESCE and NVL?

In Oracle when we have a table that has two campuses A and B, and in selection ( select ) we want to show B when A is null we have two commands that present us with the solution: Coalesce Select COALESCE(A,B) Teste from TabelaTeste...
asked by 10.11.2017 / 18:11
5
answers

Is it possible to update the first 100 rows in sql (server)?

UPDATE tbl_venda SET produto=1 WHERE produto=3 The problem is that there are more than 10,000 lines of sales and the pc hangs. I would if it was possible to make 100 in 100, 500 in 500, not to get heavy.     
asked by 16.02.2017 / 16:11
3
answers

How to access the code behind a Stored Procedure?

How can I access the code behind a stored procedure ? Home I am using Microsoft SQL Server Management Studio .     
asked by 30.06.2017 / 21:47
2
answers

GROUP BY SQL error

I have the following exercise:    List department code and name, the earliest and oldest admission date of each   department, sort by department name.    I was able to do the following: select d.department_id, d.department_name, max(jh...
asked by 30.08.2017 / 20:15
4
answers

Column 'idusuario' in where clause is ambiguous

I'm trying to make a select with inner join . Running the select in phpmyadmin the ERR that returns is this:    Column 'idusuario' in where clause is ambiguous <?php $idusuario = $_GET['idusuario']; $getCli=...
asked by 12.09.2017 / 16:43
5
answers

Change NULL value in SQL SERVER

How to change the NULL value in sql server for example 'NONE', how to leave this fixed? My result is coming like this: Florida United States NULL 16 Nevada United States NULL 17 Nevada United States Cell Phone 7 Nevada Unite...
asked by 19.09.2014 / 20:56
4
answers

Return multiple arrays using a buffer without overloading memory

I'm developing an application where, in a report, I need to print something around 50,000 lines. When executing SELECT the error occurs:    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried   to allocate 24 bytes) in   C: \...
asked by 27.02.2014 / 21:24
3
answers

Join only if the above query returns records

Good people, I would like to know what approach they would take to make a union only if the above query, from the union, returns values. Consider that the tables are compatible EX: SELECT * FROM Tabela1 UNION SELECT * FROM Tabela2 /*Esta q...
asked by 02.06.2016 / 19:11
3
answers

Structure table day and time (calendar type)

I need to create a table that contains days and times of operation of an establishment, a sort of agenda. This table should represent every day of the week and each day contain the opening and closing times. The challenge is to create this table...
asked by 07.11.2016 / 15:37
2
answers

Group By different results

Hello, I have a question if anyone can help me about SQL. I know the Group By clause, as far as I know how to group similar data. But I understand that it should group but in the script below it has the group by show lines and without the group...
asked by 24.08.2017 / 22:16