Viewing 15 posts - 7,816 through 7,830 (of 10,144 total)
Nice 🙂
Laying out the table structures and the insert statements has encouraged you to do almost all of the work.
You could answer question 1 like this:
-- problem 1 "...
June 14, 2010 at 6:34 am
Two different solutions.
-- query 1
SELECT o.id, o.first, o.last, o.person_id, o.id_master
FROM (
SELECT d.id, d.first, d.last, d.person_id, d.id_master,
x = COUNT(*) OVER (PARTITION BY d.person_id)
FROM #duplicates d
INNER JOIN #blacklist...
June 14, 2010 at 4:34 am
Please provide scripts to create all three tables and populate the source table with data.
June 14, 2010 at 4:07 am
CREATE TABLE ##a(id int identity(0,2))
INSERT INTO ##a DEFAULT VALUES
INSERT INTO ##a DEFAULT VALUES
INSERT INTO ##a DEFAULT VALUES
INSERT INTO ##a DEFAULT VALUES
SELECT * FROM ##a
June 14, 2010 at 4:05 am
Matt Mitchell (6/13/2010)
Matt Mitchell (6/12/2010)
Gets my vote!The question does highlight thebenegits of stating the problem in English though.
and also the benefits of reading what you've put before posting!
Lol!
Shame the...
June 14, 2010 at 3:34 am
The sample data is a little late but never mind - what are the column names?
June 11, 2010 at 4:09 am
lart.expert (6/11/2010)
Is it me, or does this look like a homework question?
Unlikely as OP has been a forum member for over two years.
June 11, 2010 at 3:52 am
DROP TABLE #test
CREATE TABLE #test
(
IdX INT,
IdY INT,
...
June 11, 2010 at 3:09 am
DROP TABLE #Table
CREATE TABLE #Table (A INTEGER)
INSERT INTO #Table (A)
SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4
SELECT *
FROM #Table
ORDER BY
CASE
WHEN A...
June 11, 2010 at 2:58 am
skcadavre (6/8/2010)
June 8, 2010 at 9:06 am
GilaMonster (6/8/2010)
Scott-144766 (6/7/2010)
Sadly, tuberculosis isn't a thing of the past like smallpox. It infects a third of the world's population and kills over a million people a year.
In some parts...
June 8, 2010 at 8:27 am
If you have to aggregate your results, and I'm sure you do given the number of rows you're processing, then GROUP BY is almost certainly the fastest way to do...
June 8, 2010 at 7:23 am
tosscrosby (6/8/2010)
mbricker-600840 (6/8/2010)
WhirligigDid you know they could be "hand or friction" powered? :w00t: I don't even want to know......
Hand or friction powered aquatic beetle?
June 8, 2010 at 7:02 am
Gopi Muluka (6/8/2010)
DECLARE @Table1 TABLE (ID INT , Employee VARCHAR(50))
DECLARE @Table2 TABLE (SourceFieldChar CHAR(1),Val CHAR(1) )
INSERT INTO @Table1
SELECT 1,'Ritesh' UNION ALL
SELECT 2, 'Bhatt'
INSERT INTO @Table2
SELECT 'R','X' UNION ALL
SELECT 'i',...
June 8, 2010 at 6:17 am
The best way? Impossible to tell from what you've provided. Which output columns do you want, and from which tables? Build a SELECT...FROM...with a modest restriction and test it. Look...
June 8, 2010 at 5:44 am
Viewing 15 posts - 7,816 through 7,830 (of 10,144 total)