Viewing 15 posts - 1 through 15 (of 15 total)
I would do this way:
DECLARE @t TABLE(Empid INT,Empskills VARCHAR(3))
INSERT INTO @t(Empid ,Empskills)
VALUES (1, 'C'),(1, 'CPP'),(1, 'VB'),(2, 'C'),(2, 'CPP'),(3, 'C'),(4, 'CPP');
SELECT empid FROM @t
WHERE empskills in ('C','CPP')
GROUP BY empid
HAVING COUNT(DISTINCT empskills)=2
September 25, 2013 at 2:08 am
You can not use this in VIEW. Use XML approach in VIEW.
March 21, 2011 at 5:02 am
arty 15255 (3/21/2011)
In regards distinct values:SELECT @S = ISNULL(@s+',','')+field FROM dbo.TABLE
GROUP BY field
works well too.
I forgot to mention that ORDER BY field works as well 🙂
March 21, 2011 at 3:17 am
In regards distinct values:
SELECT @S = ISNULL(@s+',','')+field FROM dbo.TABLE
GROUP BY field
works well too.
March 21, 2011 at 3:15 am
Mike Dougherty-384281 (2/24/2011)
arty 15255 (2/24/2011)
I like newbies 🙂
You can always correct their sql statments 🙂
...
UPDATE tbl_kvp SET
@value = column_value+1,
column_value = @value
February 24, 2011 at 8:23 am
arturmariojr (2/24/2011)
February 24, 2011 at 5:46 am
arturmariojr (2/24/2011)
February 24, 2011 at 5:12 am
I also use SCOPE_IDENTITY();
Why would you need to waste memory using temp mem tables.
February 24, 2011 at 3:42 am
I am using SQL Server 2005. I am not sure which service pack i had when i had this issue.
It might be that I am wrong.
It was long time...
January 28, 2011 at 5:21 am
I had the same issue.
After some investigation I found that some temp tables (CREATE TABLE #...) are not dropped in some of my procedures.
After adding precisely everywhere DROP TABLE...
January 28, 2011 at 2:59 am
Then, here is mine version of UDF:
create function fn_convert_ucase
(@s nvarchar(max))
returns nvarchar(max)
as
begin
if @S is null goto ex
set @S = char(160)+replace(@s,' ',char(160))
...
November 15, 2010 at 7:14 am
Does that mean that looping through each character is better?
November 15, 2010 at 7:02 am
Why nobody likes my solution without UDF, WHILEs, Dynamic SQL statments, etc ...
🙂
Create Table #Import_Data_Filter (MyID Int Identity(1,1) NOT NULL, Location varchar(100))
Insert into #Import_Data_Filter (Location)
(Select Lower('Mandarin') UNION ALL Select...
November 15, 2010 at 6:30 am
my solution:
Create Table #Import_Data_Filter (MyID Int Identity(1,1) NOT NULL, Location varchar(100))
Insert into #Import_Data_Filter (Location)
(Select Lower('Mandarin') UNION ALL Select Lower('San Jose') UNION ALL Select Lower('Baymeadows') UNION ALL
Select Lower('My FH Locale') UNION...
October 18, 2010 at 1:46 am
Viewing 15 posts - 1 through 15 (of 15 total)