Questions tagged as 'sql'

2
answers

Date of database returning 31/12/1969

I have in my script a call to date and to start for me brings me a date of 12/31/1969, not the date that is in the database. data. This is my Code: @$pag = "$_GET[pag]"; if($pag >= '1'){ $pag = $pag; }else{...
asked by 30.09.2015 / 20:03
1
answer

Why does this query return *?

Why does this query return me * ? select convert(varchar(2), 141) I thought it was the ascii table, but the 141, does not match the *. I use SQL Server 2008 R2     
asked by 19.02.2015 / 17:10
1
answer

Compare COUNT of two tables

I have two tables and should I return the table total with more data, I'm doing this: SELECT CASE WHEN ((select count(*) as 'familiar' from tb.familiar)) > ((select count(*) as 'personal' from tb.personal))...
asked by 19.10.2016 / 17:54
3
answers

How to index and update a user comparison system?

I have 2 tables with characteristics and interests of users in a MySQL database with innoDB    Feature Table id nome sobrenome cidade estadocivil altura peso fisico pele olhos filhos querofilhos bebo fumo denominacao frequencia importancia...
asked by 06.03.2014 / 19:17
2
answers

How Parallel hint works

One of the first things I see a galley suggesting to increase the performance of a query in Oracle is the use of hint Parallel . What are the benefits / risks that the use of this hint can bring, can I have problems with compe...
asked by 11.07.2017 / 15:46
1
answer

Double rule in LIMIT

I have a news table with the fields titulo , conteudo and destaque , the highlight being int (1), is a Boolean value only to check if a news item is highlighted or not, what would you like to do is to select a quantity of news...
asked by 23.12.2018 / 00:06
3
answers

What is the most correct way to query with LINQ?

I'm trying to make a LINQ query on my DB SQL Server, but its result always comes 'null'. I need the first userid on which I query. This is the way I try to query it: public decimal GetCustomerBalance(long accountCurrentAdvisorId) {...
asked by 11.04.2015 / 05:46
1
answer

Filling aggregate class from dataTable using a Dataset with LINQ C #

I'm having trouble filling an aggregate class in C #. Is it possible using LINQ? Does anyone have any examples of how to work around this problem using the return of a DataTable or DataSet ? public class OrderDetails { . . ....
asked by 20.05.2015 / 05:43
1
answer

Is there a way to open a straight SQL table in a data.table without doing the SQL data.frame data.table path?

I want to open a straight SQL table in a data.table. When I query with dbGetQuery , what I get is a data.frame. I know I can later turn that data.frame into a data.table easily. But I'd like to skip this step - which on some occasions may...
asked by 19.09.2014 / 13:27
1
answer

Group by with subdivisions

I have a SQL that brings the number of people who graduated on a certain date. Let's say that of 300 people, 25 graduated on '2010-06-27'. I would like to include two more columns that will return the number of men and women of those 25 peopl...
asked by 10.12.2015 / 14:22