Questions tagged as 'sql'

1
answer

SQL grouping information

I have the following sql statement: SELECT * FROM TB_CADPRECO WHERE MAT_GESTOR = 123 AND UF_PRODUTO LIKE 'PR' AND TIPO_CAMPANHA = 5 AND DT_CAMPANHA = '01.08.2018' UNION SELECT * FROM TB_CADPRECO WHERE MAT_GESTOR = 123 AND UF_PRODUTO LIKE 'PR'...
asked by 24.01.2018 / 17:47
4
answers

Using MySQL to create a Select that looks for words "together"

In MySQL how to create a select that looks for words "together". For example: SELECT pessoa FROM tabela WHERE pessoa like '%josedasilva%' But this way it does not return anything. Because it is registered as "José da Silva". I would like y...
asked by 17.01.2018 / 20:13
1
answer

How to create a JOB in ORACLE for backup?

Good afternoon guys! I'm still new to the subject when it comes to sql, I'd like to know how to create a JOB (or another operation that does the same) that performs a data extraction from a table to a .sql file in a directory I set . If it...
asked by 17.01.2018 / 14:55
0
answers

I changed the SA password and Visual Studio can not map Bank objects

I have changed the password of my SA SQL Server user by Management Studio. I tested it in Management and everything went well, I created a 'Test' database with a table called 'Testing' and I went to test with Visual Studio     Home I created a W...
asked by 21.01.2018 / 20:07
0
answers

auto_increment command for Id does not work after deleting data and rewriting them

When I create a table with the column "Id int null auto_increment" and enter values in the table, after deleting the values and reinserting them, the Id does not start from 1, and sometimes with a random order. And besides 8 row (s) affected Rec...
asked by 21.01.2018 / 18:14
1
answer

SQL server xml field filtered by a field with namespace

I tried via seq to filter a record that had an xml field, with that xml below: <ns1:Prod xmlns:ns1="uri"> <ns1:ProductID>316</ns1:ProductID> <ns1:Name>Blade</ns1:Name> </ns1:Prod> <ns1:Pro...
asked by 10.01.2018 / 19:20
0
answers

Generate random number with repeat rule

I need an SQL command that generates a random number between 1 and 11, and for number 1 to be generated more frequently than the others. I currently use the following command: FLOOR(1 + (RAND() * 11)) It is in a SQL WHERE command, exampl...
asked by 11.01.2018 / 17:10
0
answers

Category and subcategory in the same table

Talk the guys! I need to create a system that includes categories and subcategories ... however, these two must be in a single table with the columns id, category, category_id and exc. Does anyone know how I should do this? Thank you in advance!...
asked by 18.01.2018 / 18:13
1
answer

How to add the XML encoding tag

Adding the XML encoding clause <?xml version="1.0" encoding="UTF-8"?> When you generate the XML through FOR XML PATH as the following example: SQL query: WITH XMLNAMESPACES (DEFAULT 'http:\www.oobj.com.br') select '1.0...
asked by 12.01.2018 / 18:49
0
answers

fill combobox with data from another combobox

I have a City table where you have the fields NameChild, IdEst, IdPais, in addition to the State and Parent tables. I'm doing an application in C # where I use 3 combobox. When selecting the first combobox (cboCity) and choosing a record, I want...
asked by 05.01.2018 / 22:58