Viewing 15 posts - 406 through 420 (of 445 total)
abhas (9/18/2014)
There are more rows for CanNum as below: and in such case its failing. I want to compare only latest two.
I can Add one more column into table...
September 22, 2014 at 1:10 am
Use dynamic SQL. No static query can produce varying number of columns .
Please provide more details on your requiements to get more assistance. What is the proc input? Is it...
September 22, 2014 at 12:52 am
Overlap (x,y) == (x.Start <= y.End AND y.Start <= x.End)
Here overlap means intervals x and y have at least one common point. Intervals are closed, ie boundaries are included. Otherwise...
September 18, 2014 at 8:31 am
Luis Cazares (9/17/2014)
EDIT: Unless someone proves me wrong, it cannot be made without functions or a CASE statement. At least not in SQL Server...
September 18, 2014 at 12:53 am
Cannt figure out why jobs 5 and 7 are to be in the result set while they overlap with job 2.
The query must ignore overlapping when ... what?
September 17, 2014 at 6:51 am
See above. Tried to edit and posted once again instead. 🙁
September 17, 2014 at 2:38 am
((1-Flag)*Qty*(CF2/CF1) + Flag*Qty) * nullif (1-abs(sign((1-Flag)*Flag)),0)
Qty*(CF2/CF1) when Flag==0,
Qty when Flag==1,
NULL otherwise.
September 17, 2014 at 2:33 am
Try
create table #test (Code varchar(1000))
insert into #test (Code)
select 'Q074;Q221;Y714;M459;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;' union all
select 'Q233;Y752;Z942;Q124;Q074;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;' union all
select 'Q233;Y959;Z943;Q084;Q241;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;' union all
select 'Q074;Q233;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;' union all
select ';Q221;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;' union all
select 'Q074;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;'
select code
from #test
cross...
September 16, 2014 at 4:02 am
Amstrong numbers. OK, Will try to remember it. 🙂
Minor code improvement. SUBSTRING() : If start_expression is greater than the number of characters in the value expression, a zero-length expression is...
September 16, 2014 at 3:26 am
Discarded my post as reiterating previous findings.
TomThomson and Hugo Kornelis thank you for yours comments.
September 15, 2014 at 5:37 am
barry.mcconnell (9/8/2014)
September 12, 2014 at 3:06 am
Although the first two chunks indicate clearly that NULL is ordered low by ORDER BY, they don't indicate anything else.
Exactly. Remember Oracle's ORDER BY ... NULLS FIRST.
ORDER BY must place...
September 12, 2014 at 1:57 am
Also note empty string may be rather lengthy 🙂
declare @user varchar(30)
set @user = char(0) + char(0) + char(0)
IF isnull (@user,'') != '' -- also try other discussed checks
BEGIN
...
September 11, 2014 at 7:08 am
Sean Lange (5/28/2014)
May 29, 2014 at 6:33 am
On logic error.
Having no PK and joining just by a single column to match the updated row may be considered as a logic error as well.
April 3, 2014 at 1:28 am
Viewing 15 posts - 406 through 420 (of 445 total)