Viewing 15 posts - 9,706 through 9,720 (of 10,143 total)
Vaseem, try it with a little extra data...
INSERT INTO #Temp (Skilltype) select 'c, c++ (6),web development (6), java (3), unknown (21)'
INSERT INTO #Temp (Skilltype) select 'c# (15), design (12),windows...
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
August 1, 2008 at 5:49 am
vaseem (8/1/2008)
HiUse this SQL
select * from temp222 where ','+skilltype+',' not like '%,c,%'
Thanks
Vaseem
This looks interesting Vaseem, would you mind elaborating with some sample data?
Cheers
ChrisM
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
August 1, 2008 at 5:38 am
Atif Sheikh (8/1/2008)
I dont know why are you going for TOP 1/
Just run the two queries...
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
August 1, 2008 at 5:31 am
Not really, you've lost the derived table d.
If you're comparing values from different rows of a table, then you have to join the table in more than once. You're...
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
August 1, 2008 at 5:15 am
Hi John
It's going to look something like this:
SELECT m.ProductID, m.ProductName, m.Price, t.Price
FROM MyPricingTable m
LEFT JOIN TheirPricingTable t ON t.ProductID = m.ProductID
WHERE t.Price - m.Price > 20
There's very little information...
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
August 1, 2008 at 4:36 am
You need to match the pattern at the beginning and end of the string, and in the middle, in different ways:
SET NOCOUNT ON
DROP table #Temp
CREATE TABLE #Temp (ID Int identity(1,1),Skilltype...
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
August 1, 2008 at 4:29 am
Untested, of course...
SELECT h.OrderID, h.OrderDate, h.address, c.address, p.cardno, c.cardno
FROM T_OrderHeader h
INNER JOIN T_Customers c ON c.CustomerID = h.CustomerID
LEFT OUTER JOIN T_Payments p ON p.OrderID = h.OrderID
INNER JOIN (SELECT h.OrderID, h.OrderDate,...
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
August 1, 2008 at 3:52 am
As a separate query to the one above, or built into it? Also, card number is in the customer table, are you sure you want to use card number from...
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
August 1, 2008 at 3:34 am
You're welcome, and thanks for the feedback.
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
August 1, 2008 at 3:02 am
Yes of course! Can you name the date column (and table) which you would like to use for this?
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
August 1, 2008 at 2:59 am
Hi Meeraj, apologies for the delay in replying to you.
Here's a script for creating a Numbers or Tally table, which you will see often on this forum.
IF EXISTS (select...
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
August 1, 2008 at 2:54 am
There's an answer in this, Meeraj:
SELECT * FROM [dbo].[uftSplitString] ('232,33,546,2,4,5,7,8,1091,223,3434', ',')
CREATE FUNCTION [dbo].[uftSplitString]
(
@String VARCHAR(8000),
@Delimiter VARCHAR(255)
)
RETURNS
@Results TABLE
(
SeqNo INT IDENTITY(1, 1),
Item VARCHAR(8000)
)...
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
July 31, 2008 at 4:50 am
Something like this?
SELECT h.OrderID, h.address, c.address, p.cardno, c.cardno
FROM T_OrderHeader h
INNER JOIN T_Customers c ON c.CustomerID = h.CustomerID
LEFT OUTER JOIN T_Payments p ON p.OrderID = h.OrderID
WHERE h.address <> c.address
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
July 31, 2008 at 4:42 am
and...
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
July 31, 2008 at 4:24 am
What's your point, Karthik? Chris knows exactly what the output will be for any pair of numbers entered into his query...
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
July 31, 2008 at 4:17 am
Viewing 15 posts - 9,706 through 9,720 (of 10,143 total)