Viewing 15 posts - 1,201 through 1,215 (of 2,458 total)
Scott did my first solution (that one only scans the table once)...
Here's another way:
SELECT UniqID
FROM #SampleData
WHERE Code = 'ABC'
EXCEPT
SELECT UniqID
FROM #SampleData
WHERE Code <> 'ABC'
October 22, 2015 at 3:36 pm
ignacio.jose (10/22/2015)
Just finished reading http://www.sqlservercentral.com/articles/Tally+Table/72993/Impresive
That article certainly helped me a great deal.
October 22, 2015 at 7:55 am
ignacio.jose (10/21/2015)
Then you will have to...
October 21, 2015 at 9:57 pm
First welcome to SSC.
My solution uses a hacked version of Jeff Moden's DelimitedSplit8K (the splitter mentioned in my signature). If you have not worked with a splitter before I...
October 21, 2015 at 9:54 pm
Using the splitter in my signature line you could do this:
-- let's create some easily consumable DDL
DECLARE @YourTable TABLE (RowNumber int primary key, Comments varchar(1000) NOT NULL);
-- Insert sample values
INSERT...
October 21, 2015 at 9:05 pm
mr.addikhan (10/20/2015)
Alan.B (10/20/2015)
mr.addikhan (10/20/2015)
its not working 🙁 my tbl name is tblemp column name is empaddress
I would suggest taking what I posted (or what Luis posted if order...
October 20, 2015 at 2:30 pm
mr.addikhan (10/20/2015)
its not working 🙁 my tbl name is tblemp column name is empaddress
I would suggest taking what I posted (or what Luis posted if order is important)...
October 20, 2015 at 2:19 pm
Luis Cazares (10/20/2015)
CREATE FUNCTION dbo.RemoveDupes(@string varchar(8000))
RETURNS TABLE AS
RETURN
WITH CTE AS(
SELECT...
October 20, 2015 at 2:17 pm
using the splitter referenced in my signature line, you could create this function:
CREATE FUNCTION dbo.RemoveDupes(@string varchar(8000))
RETURNS TABLE AS RETURN
SELECT NewString =
(
SELECT DISTINCT item+' '
FROM DelimitedSplit8K(@string,' ')
FOR XML PATH(''),...
October 20, 2015 at 2:00 pm
Using Eirkur's sample data and the aforementioned splitter, you could do this:
UPDATE dbo.TBL_SAMPLE_PARSE
SET MyString = REPLACE(REPLACE(MyString,',',' '),'.',' ')
SELECT DISTINCT Item
FROM TBL_SAMPLE_PARSE
CROSS APPLY dbo.delimitedSplit8K(MyString, ' ')
WHERE item LIKE '%[##%##]%' ESCAPE '[';
Edit:...
October 20, 2015 at 1:48 pm
Sean Lange (10/15/2015)
nguyenanhminhxd (10/15/2015)
October 15, 2015 at 2:54 pm
-- Create a table
IF OBJECT_ID('tempdb..#X') IS NOT NULL DROP TABLE #X;
CREATE TABLE #X (x int)
-- start transaction
BEGIN TRANSACTION
INSERT #X SELECT 1
INSERT #X SELECT 2
INSERT...
October 15, 2015 at 2:52 pm
timwell (10/15/2015)
Eric M Russell (10/15/2015)
I believe Excel is more often used for professional data analysis than MS Access. What functionality is missing from Excel that she finds in MS Access?
I...
October 15, 2015 at 2:43 pm
You can also do this:
SELECT
J.DT_ID
,J.InvNo
,Salesmman = SUBSTRING(J.SalesCode,1,CHARINDEX('!',J.SalesCode)-1)
,Commision = SUBSTRING(J.Amount,1,CHARINDEX('!',J.Amount)-1)
FROM @TEST_DATA J
October 15, 2015 at 2:32 pm
Is calculating the median in the SQL Query that feeds the report an option?
October 15, 2015 at 11:01 am
Viewing 15 posts - 1,201 through 1,215 (of 2,458 total)