Questions tagged as 'sql'

2
answers

Problems in a SQL query [closed]

Hello, In the following query, an error is encountered in the execution: select fto.id_taxon, fto.cd_sexo as fto_cd_sexo, fto.cd_idade as fto_idade, x.ftv_cd_sexo, x.ftv_cd_idade, x.id_fv from tb_foto_oco...
asked by 23.12.2015 / 15:37
1
answer

Oracle SQL - Query multiple schemas

I was able to assemble the result, but now I want to create the view with this result. What is the best way? This query: "SELECT CONCAT(CONCAT(CONCAT('SELECT * FROM ',a.OWNER),'.TAB2'),CASE WHEN a.OWNER = UPPER(b.TESTE1) THEN '' ELSE ' UNIO...
asked by 13.11.2015 / 10:58
1
answer

How to see the disk space that the index occupies in the database?

I have the table maintenance with the column product_id (varchar (MAX)) , but it is not the primary key, the table has 900 thousand records so I decided to create indexes to optimize searches. I've done the following tests: create index...
asked by 04.11.2015 / 18:28
1
answer

Duplicate records in SQL - Oracle

Good morning, I'm new here and I have a boring problem. Distinct does not solve my problem because the duplication is due to the fact that I had to make the relationship with other tables to look for information. I have a SQL statement that I wa...
asked by 05.07.2016 / 15:50
1
answer

INSERT within clause WITH

I basically learned SQL with PostgreSQL, I am first making use of SQL Server and could not figure out how to do this in it. Let's say I have two tables. The first is a generic transaction table (sales, rentals, bookings, etc.) CREATETABLE[db...
asked by 05.07.2016 / 17:51
2
answers

Query Performance in MySql

I have in my form the option to perform a search for Rg or Cpf. Then I came to doubt about query performance using the following code: SELECT * FROM DADOSPESSOAIS WHERE (Rg = @Rg OR Cpf = @Cpf); This code above "costs" more than if I made t...
asked by 02.12.2015 / 12:02
9
answers

How to prevent SQL injection in my PHP code?

I developed a page in PHP for internal use of the company I work with and only very few people use it. You can use this page to do some queries, insertions, changes and deletions of a table in a MySQL database, however I believe that my PHP code...
asked by 03.02.2014 / 13:37
0
answers

Access File Database File, SYBASE

I need to remove data from a database file (.db) file that I was told is SYBASE, the client needs to migrate data and need access, does anyone have a clue where to start? because you never hear of sybase. Remembering that it is not a server,...
asked by 20.10.2015 / 06:01
2
answers

How to mount query in PDO with items before concatenated

The question is as follows, in mysql we can concatenate a query and then perform the search, as follows: $cidades = '&& (cidade = 100 || cidade = 101 || cidade = 102)'; $order = 'id ASC'; $sql = 'SELECT * FROM tabela WHERE status = 1...
asked by 13.10.2015 / 22:45
1
answer

Doubt User table and Friend table

Hey guys, I need help, I'm a beginner in java, and I'm doing a college job where it's going to be a mini social network, in the beginning let's do user registration, inside the beans class, user receives a Friend List I'm com a doubt. My ques...
asked by 15.10.2015 / 15:21