Questions tagged as 'sql'

2
answers

SQL query with array type in PostgreSQL

How to filter this field of type array in PostgreSQL? I have a X table with a Y field of type character varying[] with two records: {'meeting','lunch','training','presentation'} {'breakfast','consulting', 'meeting'}...
asked by 12.08.2015 / 16:07
1
answer

How to do "OR" between SubQuerys using LINQ C #

I would like to implement with LINQ C # (Using NHibernate as the following query : < return (from t1 in Session.Query<Tabela1>() join t2 in Session.Query<Tabela2>() on t1 equals t2.T1 where (from t...
asked by 12.05.2014 / 15:04
5
answers

How to select the records that have relation with all the values of a list?

I have the following sql: SELECT DISTINCT cp_pessoa.id, cp_pessoa.nome FROM cp_pessoa LEFT JOIN cp_habilidade_freelancer ON (cp_habilidade_freelancer.id_freelancer = cp_pessoa.id) LEFT JOIN cp_habilidade ON (cp_habilidade.id = cp_habilidade...
asked by 10.02.2014 / 10:02
1
answer

How to do a select based on data from another table

I have to make the following adaptation in a query: Table app_usuários : id, nome, sobrenome, hash, sexo, interesse, latitude e longitude . Table app_likes : id, user_a_id, user_b_id Briefly, I have a query that...
asked by 28.08.2018 / 12:04
1
answer

Oracle - Filter by date

I have a column dt_atualiza_log that is with type DATE in the table (it is saved in the 01/12/2011 10:10:48 format) I'm not able to filter on and of my query . I have tried in many ways, the last one: AND ma.dt_atualiz...
asked by 11.06.2018 / 18:29
1
answer

Difference between select a. or b [closed]

What is the difference of doing the search by select a. or b.? Example: select --a.num_duplicata,a.data_prorrogacao,a.seq_duplicatas, a.cli_dup_cgc_cli9 as cgc9,a.cli_dup_cgc_cli4 as cgc4,a.cli_dup_cgc_cli2 as cgc2,b.nome_cliente as...
asked by 18.10.2017 / 17:08
1
answer

Is there anything similar to SQL SERVER WITH (NOLOCK) in ORACLE?

I recently discovered in SQL SERVER the option of not locking tables for insertion while reading some data, and thus gain some performance in some specific situations. I searched, but I did not find anything similar in ORACLE. Does anyone kno...
asked by 12.02.2016 / 13:59
3
answers

Doubt with GetDate ()?

I'm having an SQL query that should bring me only the records whose date is greater than the date of the day, plus is coming records with the current date. Thanks! --não deveria mostrar a data de hoje select a.datavencimento from TB_RECEB...
asked by 28.04.2015 / 22:35
1
answer

What's the difference between Cast and Convert?

In a Transact-SQL book (Ramalho Series) it is said: CAST AND CONVERT    Implicitly converts one expression from data types to another.   CAST is a synonym for CONVERT. What do you mean by CAST is synonymous with CONVERT? What is the us...
asked by 21.06.2017 / 13:58
1
answer

How to concatenate date in sql server

I have a field where the date and time is saved: '2013-06-13 00:00:01' and '2013-06-13 11:59:59' I want to make an appointment by passing the date and a fixed time: CONVERT(VARCHAR(10), CAST(getdate() AS DATETIME), 111) + '00:00:01' and...
asked by 04.10.2016 / 20:09