Viewing 15 posts - 8,491 through 8,505 (of 10,143 total)
bvinay57 (4/15/2009)
select NULLIF( STATE, 'null') AS state FROM T1 i have used this it is giving empty string in null values but i want to replace the string with 'all'
can...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
April 15, 2009 at 7:09 am
venki (4/15/2009)
I am sorry to bother you. The problem is fixed now. There is a duplicate data for that column where user is trying change...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
April 15, 2009 at 6:43 am
krayknot (4/15/2009)
I removed the return statement from the stored procedure.
Why? Now the stored procedure doesn't work - it will insert a row whether it's required or not.
krayknot (4/15/2009)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
April 15, 2009 at 6:05 am
Hello
Can you please provide a table creation script and some sample data in an easily-cunsumable format? This will show you roughly how to do it:
CREATE TABLE #sample (id INT, Ecode1...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
April 15, 2009 at 5:48 am
What's the name of the primary key column?
How are new values for the PK generated?
The Access application may be attempting to change the value in the PK column on the...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
April 15, 2009 at 5:44 am
bvinay57 (4/15/2009)
Hisorry i am using mssql not mysql now can u please tell me how to replace a null value with string.
Thanx
Use ISNULL() or COALESCE() as suggested.
Either will work...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
April 15, 2009 at 5:19 am
@puyinc (4/15/2009)
What I wanted to do is to return the values of the Meal column in the...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
April 15, 2009 at 5:11 am
Here's an unpivot method, for the record:
DROP TABLE #sample
--
CREATE TABLE #sample (id INT, Ecode1 VARCHAR(5), Ecode2 VARCHAR(5), Ecode3 VARCHAR(5), Ecode4 VARCHAR(5), Ecode5 VARCHAR(5))
--
INSERT INTO #sample (id,...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
April 15, 2009 at 2:48 am
A very simple solution is possible using UNPIVOT, but it relies upon an ID column...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
April 14, 2009 at 10:19 am
kwood111 (4/14/2009)
ghollis - thank you, I think that just may work. I am going to give it a rip this morning and see what happens.q-kev
Does the table have an ID...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
April 14, 2009 at 9:36 am
andrew.rendall (4/14/2009)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
April 14, 2009 at 9:34 am
Does the table have an ID column?
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
April 14, 2009 at 9:28 am
Are your results from running Steve's code?
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
April 14, 2009 at 9:22 am
You're welcome.
Did you mean storing your intermediate result in a temp table, or using it as source for your id's? There might be some mileage in this approach:
DROP TABLE...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
April 14, 2009 at 6:12 am
Hello
Two quick suggestions.
Firstly, merging the rows:
select a.*, '#' AS '#', b.*
from db..table a with (nolock)
LEFT JOIN db..table b ON b.id = a.id + 1 and b.RecordType='C'
where b.id in (944770735,944770759,948267730,948267745)
Secondly...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
April 14, 2009 at 5:20 am
Viewing 15 posts - 8,491 through 8,505 (of 10,143 total)