Viewing 15 posts - 9,706 through 9,720 (of 10,144 total)
Why use a simple solution when a complicated one works just as well? 😛
SET NOCOUNT ON
DROP TABLE #Temp
CREATE TABLE #Temp ([ID] Int identity(1,1),Skilltype varchar(1000))
INSERT INTO #Temp (Skilltype) select 'c, ...
August 1, 2008 at 6:26 am
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...
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
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...
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...
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...
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...
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,...
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...
August 1, 2008 at 3:34 am
You're welcome, and thanks for the feedback.
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?
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...
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)
)...
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
July 31, 2008 at 4:42 am
Viewing 15 posts - 9,706 through 9,720 (of 10,144 total)