Viewing 15 posts - 16 through 30 (of 133 total)
I want to divide 11 into 4 groups then output should be 3,3,3,2. same way 10 for for group would be 3,3,2,2. ..
Look up the NTILE() function.
Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
December 14, 2016 at 1:24 pm
its working ok with ORDER BY and the same results are been returned...
what does that mean though? that you always have to insert ORDER BY ?
You are missing some fundamental...
Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
December 14, 2016 at 1:21 pm
It wouldn't be SSN, because (1) that can change and (2) it might not technically be legal in certain use cases for a private company to use that.
Yes, but...
Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
December 13, 2016 at 4:10 pm
>> For simplicity sake, say we have the following tables:<<
It would have been simpler if you posted real DDL, complete with constraints keys and references. What we have here is...
Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
December 13, 2016 at 11:12 am
Get a book on logic and read the section on DeMorgan's Laws. But be careful! SQL has three value logic (true, false, unknown), and things do not always work the...
Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
December 12, 2016 at 10:54 am
We really need to turn what you posted into an actual table. That means keys, constraints, etc.
CREATE TABLE Date_Ranges
(start_date DATE NOT NULL,
end_date DATE NOT NULL,
PRIMARY KEY (start_date,...
Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
December 12, 2016 at 10:51 am
constraining this type of column to be NOT NULL would seem to eliminate the possibility of representing an unknown value, or are you suggesting that everything should be in...
Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
December 8, 2016 at 3:55 pm
How many times do you have to be reminded that T-SQL does not support the Boolean data type that ANSI SQL recommends in place of the bit flag?
[/quote]
Actually, I...
Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
December 6, 2016 at 6:48 pm
Now you're just making up stuff to support your claims.
No, I get called in every now and then by product developers a lot of different SQL companies to make...
Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
December 6, 2016 at 3:10 pm
You know that we have two options, either portable code or fast code. You can't have both.
No, I do not know that because the building entire career on...
Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
December 6, 2016 at 2:39 pm
>> see script below: <<
We need to see the DDL. Did you read the forum rules before you posted? What you have posted is really awful. You do not know...
Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
December 6, 2016 at 1:51 pm
I would like you to think about the proprietary syntax and what it really means. Essentially, although you probably do not know know it, you are doing a nineteen fifties...
Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
December 6, 2016 at 12:53 pm
>> I want to optimise the following query that is running so slowly. <<
First of all, we need some DDL what you did post is really bad. You put...
Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
December 6, 2016 at 11:53 am
Still trying to figure out what he really wants, but I am thinking maybe this is a linear programming problem? Let us be honest, SQL is not really good at...
Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
December 6, 2016 at 11:04 am
Correct minor typos:
INSERT INTO Forest
VALUES
('Root',1,8),
('first child of root',2, 5),
('first child of first child of root',3,4),
('second child of root', 6,7),
--- this has to be forced in a nested sets model
('orphan',...
Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
December 6, 2016 at 10:56 am
Viewing 15 posts - 16 through 30 (of 133 total)