Viewing 15 posts - 331 through 345 (of 761 total)
You can use a Dynamic Pivot as follows:
--Creating Tables
Create Table Ex
(IDint,
rbNumber int,
rbTypevarchar(20),
rbBookdatevarchar(20),
rbBookTypeChar(1),
rbBookRef varchar(20) )
--Inserting Sample Data
Insert Into Ex
Select 403,7,'Standard Double','02 June 2012','B','447361938'
Union ALL
Select 402,7,'Standard Double','01...
June 6, 2012 at 4:44 am
You can do it like this:
Select a.year, a.week, SUM(a.total_savings) From
(Select * From Ex
union
Select * From Ex1) As a
Group By a.year, a.week
June 6, 2012 at 4:25 am
Here are a few versions of doing it:
--Creating Table
Create Table Ex
(cusid int,
name varchar(3),
email varchar(20) )
--Inserting Sample Data
Insert Into Ex
Select 111,'abc','abc@xyz.com'
union ALL
Select 222,'aaa','aaa@xyz.com'
union ALL
Select 222,'aaa','aaa1@xyz.com'
union ALL
Select 222,'aaa','aaa2@xyz.com'
union ALL
Select 222,'aaa','aaa3@xyz.com'
union...
June 6, 2012 at 3:36 am
KpSQL123 (6/6/2012)
It is one time requirement
In that case you can use any of the ways.
If you use TSQL, you would have to make sure to do it at some time...
June 6, 2012 at 3:03 am
Sorry, I fail to understand the logic used for your output. Why isn't "TRU-90-JK" in the output? And why do you have so many rows for "YTH-12-MU"?
June 6, 2012 at 1:29 am
Are you using MSSQLServer??.....Doesn't look like it to me
June 6, 2012 at 12:21 am
Sorry, one of us is missing out on something. What is the problem???....How do you want your resultset to look like?
June 6, 2012 at 12:14 am
If the Database at the Primary Server gets updated every 2 seconds and you want the Db at the Secondary Server also to get updated the may be you should...
June 5, 2012 at 11:31 pm
I have Office2003. It says File Format Not Recognized when I try to open your attachment.
I'll make this as simple as I can.
You are looking at some tables and some...
June 5, 2012 at 10:28 pm
KpSQL123 (6/5/2012)
Thanks for your reply...If i have lakhs of records how can i load
Is it a one time Requirement or a Regular thing??....If it is a one time requirement then...
June 5, 2012 at 10:18 pm
rVadim (6/5/2012)
I still haven't understood what you are trying to say. Can you come up with a better explanation of what you want to do?
(S)he probably runs your entire code...
June 5, 2012 at 10:07 pm
ankita.vinculum (6/5/2012)
I have tried to open ur link from google chrome as well as ie explorer but getting same issue on both - "Webpage cannot be display".
I checked it agaiun...
June 5, 2012 at 5:36 am
Like This:
--Creating Tables
Create table Ex
(empno int,
empname varchar(30),
empsalint,
Rownum int )
Create table Ex2
(empno int,
empname varchar(30),
empsalint,
RowNum int )
Create table Ex3
(empno int Identity(300,1), --Create...
June 5, 2012 at 5:33 am
Well, I can't see from here what data you have in your tables to know what your query is doing.
For me to give an opinion there needs to be sample...
June 5, 2012 at 5:20 am
ankita.vinculum (6/5/2012)
Thanks for ur rep.
Is this ur link - "How to post data/code on a forum to get the best help" - Jeff Moden
I had tried to open this...
June 5, 2012 at 5:14 am
Viewing 15 posts - 331 through 345 (of 761 total)