Questions tagged as 'sql'

1
answer

Group SQL values by two fields

I'm trying to group a table so I can count, but I'm having trouble. The table structure is as follows: ID - NOME - IDADE - ESCOLARIDADE 1 - João - 15 - Ensino Fundamental Completo 2 - José - 25 - Ensino Fundamental Completo 3 - Mar...
asked by 30.01.2016 / 15:55
1
answer

When I step date filter for the same day, query returns empty and there is data

In my table / base there is data for day 05/08/2015 , it happens that when I pass a date filter for the same day, it does not work, it returns empty. If I go like this: 04/08/2015 and 05/08/2015 does not work either. It only...
asked by 18.01.2016 / 12:50
1
answer

Is there a way to join multiple SELECTS in just one query?

I have a page where I will have to make several queries to the bank. At present, they are a total of three tables. They are: cadastro , publicacoes and estilo . Currently I do this: SELECT nome, sobrenome, usuario, email FRO...
asked by 31.01.2016 / 00:28
1
answer

PHP ORACLE VIEW FROM SELECT

I want to generate a view through a select with the code below, but it does not work, what can it be? $row[0] contains "select col1, col2, col3, col4, col5 from tabela1" $select= oci_parse($ora_conexao, 'SELECT *...
asked by 14.01.2016 / 17:39
1
answer

Select complex in ruby on rails

I have a model that describes the friendship between my users: #CreateFriendship.rb class CreateFriendships < ActiveRecord::Migration def change create_table :friendships do |t| t.integer :user_id t.integer :friend_id...
asked by 28.01.2016 / 18:27
1
answer

Doubt about SQL in PHP

I am currently performing a job that needs to access the database, and I had a lot of difficulty in some queries , including the query of UPDATE . But after much searching I found a solution and wanted to ask what the difference is, wh...
asked by 23.03.2016 / 19:53
1
answer

I can not insert into DateTime fields in sql database

I can not insert into the dataCriation and dataRefMove fields in the sql database private Contexto contexto; public void Inserir(RegCabecalho regCabecalho) { var strQuery = ""; strQuery += " INSERT INTO...
asked by 24.03.2016 / 23:08
1
answer

How do you hit the order by command?

I typed the following command in oracle; select * from emp where ndep in(10,30); and I had this as a result; It'sallright,theproblemisthatIwantedtoputitinthedescendingorderofthedepartmentnumber;Theseweremyattempts;1stattempt;select*from...
asked by 24.12.2015 / 18:42
2
answers

SQL - Using Distinct

Friends I need a Select that loads: (all portals linked to a user and an additional column informing which portals were selected in a given news item) So far my SQL is like this ...: select distinct case when usudesc.txt_nome is nul...
asked by 04.02.2016 / 13:27
1
answer

SQL Server Transaction Replication - Primary Key

I have an environment with 2 branches, each branch has to have an application server with a SQL SERVER installed, I configured the # that is working perfectly, however if 2 people in different branches are inserting data into the same table at t...
asked by 18.02.2016 / 20:19