Viewing 15 posts - 6,616 through 6,630 (of 26,490 total)
thava (5/17/2014)
DECLARE @Mtbl AS TABLE (id INT,Rid INT, DATA VARCHAR(10))
DECLARE @Ctbl AS TABLE (id INT,Rid INT,Tdata VARCHAR(10))
INSERT INTO @Mtbl
VALUES
(1,1,'test'),(1,2,'test'),(1,3,'test'),
(2,1,'test'),(2,2,'test'),(2,3,'test'),
(3,1,'test'),(3,2,'test'),(3,3,'test'),(3,4,'test'),
(4,1,'test'),(4,2,'test'),(4,3,'test'),(4,4,'test')
INSERT INTO @Ctbl
VALUES
(1,1,'Data1'),(1,2,'Data2'),
(3,1,'Data3'),(3,4,'Data4')
/****************Result would be like...
May 17, 2014 at 8:07 am
Here is what I would do.
I would create a table that lists the accounts that must be in a specific order with a sequence number for the order that that...
May 17, 2014 at 8:04 am
It would help if you would post the DDL for the tables including index definitions and the actual execution plans of both the fast and slow queries as .SQLPLAN files.
May 17, 2014 at 7:53 am
I still have no idea what you are trying to accomplish. Perhaps if you show us what you are trying to accomplish by providing us with DDL (CREATE TABLE...
May 15, 2014 at 12:34 pm
Sean Lange (5/15/2014)
laercionb (5/14/2014)
Type want to do a range of staff.
then have a table of date where I want to create a table...
May 15, 2014 at 7:29 am
CELKO (5/14/2014)
horse riding in ... clop, clop, clop, clop, clop > Everyone else is wrong!! My way is the only way!! < clop, clop, clop, clop, clop ......
May 15, 2014 at 7:19 am
< horse riding in ... clop, clop, clop, clop, clop > Everyone else is wrong!! My way is the only way!! < clop, clop, clop, clop, clop ... horse...
May 14, 2014 at 9:14 pm
Maybe you aren't explaining this well or I just don't get it, but what are you trying to delete? You show us a select statement and the DDL for...
May 14, 2014 at 1:15 pm
Is the temp table created on the fly (SELECT INTO) or is it predefined using CREATE TABLE and then populated with an INSERT INTO statement? If the later, what...
May 13, 2014 at 9:30 am
Hyabusact (5/13/2014)
(These are the real table, field names)
WITH BaseData as
(SELECT vendorno, count(DISTINCT checkno) AS ChkCount
FROM...
May 13, 2014 at 9:24 am
Here is the statistics of the Windowing function and the group by select queries.
********** Windowing function *********
(3 row(s) affected)
Table 'Worktable'. Scan count 3, logical reads 27, physical reads 0,...
May 12, 2014 at 9:53 pm
Eirikur Eiriksson (5/12/2014)
😎
Use tempdb;
GO
DECLARE @CUST_PAY TABLE
(
CustNO INT NOT NULL
,InvNO INT NOT NULL
,ChkNO INT NOT...
May 12, 2014 at 9:38 pm
Give this a try.
WITH BaseData as (
SELECT CustNO, count(DISTINCT ChkNo) AS ChkCount
FROM CUST_PAY
GROUP BY CustNO
)
update cust set
CustPayments = bd.ChkCount
from
dbo.CustTab cust
...
May 12, 2014 at 9:37 pm
KGJ-Dev (5/12/2014)
below is my table structure
Create table ParentMember(IdParentMember int,Name varchar(40),company varchar(40))
insert into ParentMember values (1,'Andrew','Microsoft'),
(1,'Rob','IBM'),
(1,'bob','SunMicro'),
(1,'Peter','Oracle')
Create table ChildMember(IdchildMember int,Name varchar(40),company varchar(40))
insert into ChildMember values (100,'Andrew','Microsoft'),
(101,'Blake','Microsoft'),
(102,'Rob','IBM'),
(103,'stanlye','IBM'),
(104,'bob','SunMicro'),
(105,'Peter','Oracle')
(103,'Peter','Oracle')
Required output:
select 1 as IdParentMember,100 as IdchildMember,'Microsoft'...
May 12, 2014 at 1:47 pm
Eirikur Eiriksson (5/12/2014)
ChrisM@Work (5/12/2014)
Eirikur Eiriksson (5/12/2014)
Mike Saunders NL (5/12/2014)
The only thing that is missing is that the days with no events are not mentioned. Is there a...
May 12, 2014 at 11:23 am
Viewing 15 posts - 6,616 through 6,630 (of 26,490 total)