Hi,
I am having my query result like below.
ID PID Pname Class
----------------------------
1 P1 Pname Class1
1 P1 Pname Class2
1 P1 Pname Class3
Now I want that three rows into one row like below
ID PID Pname Class1 Class2 Class3...
HI,
I Have two tables table1 and table2
Table1
--------
id Name
1 Test1
Table 2
--------
id Name
1 Test2
I need the result like below
Table1id Table2id Table1name Table2name
1 2 Test1 Test2
Can anybody help me in this.
Thanks
Kingston
HI,
In my application I am sending string to sqlserver for the columns to update.but the proceduare will substitute the value for the column.
for ex like below.
I am sending string with column name and the varibale to refer in sqlserver for value(@columnstoupdate) And I want the values to be...
I want to query a table like below.
The parameter @classval will have any class value
I want to do a T-sql for that.
Can anyb ody help me out what will be efficient way to do that.
Thought of doing some function with split but it performance is slow.
declare
@classval='Test1=2;Test3=1'
class...
HI,
if I pass fname then query should return only that condition,If null it should return all records.
declare
@fname as nvarchar(10)
set @fname=null
select * from emp where fname=@fname or @fname=null(Expected It will return all records but it returns 0 records)
I tried another approach...
folks,
In my following query I am using Table called vwrampositions which has millions of rows.
In my query after doing the join conditions and finally I am giving the where condition with date.so its doing all the join condition with millions of row and finally comes into where condition and...
hi,
i am gettung value as 14493.48000000000
I want to round to 2 decimals and take upto only 3 decimals.i need 14493.480
when i use round
select round(14493.48000000000,3)
i am getting 14493.48000000000.Can anybody help me how to
remove values other than 3 decimals.
I want 14493.480
Thanks...
HI,
I am loading the below xml in dom documnet
<x:PivotTable>
<x:OWCVersion>11.0.0.6555</x:OWCVersion>
<x:DisplayScreenTips />
<x:NoAutoFit />
<x:Height>376</x:Height>
<x:Width>1278</x:Width>
<x:CubeProvider>msolap.2</x:CubeProvider>
<x:CacheDetails />...
Folks,
In one of my requirement I have to use ADODB(since I need
old method recordset)in c#.I am trying to execute stored proc I don't know how to pass parameters from c# to adodb can anyone help me.
rs=cmd.execute(out object recordsaffected,ref object parameters,int options)
can somebody...
Folks,
I am working ion c# proj.In that I am using Microsoft office pivot table.For databing to pivot table I am planing to use older ADODB.(which makes easier).ANy body know the way where I can have a vb class in the same C# project which will return a string to my c#class.I am using .net 2.0
They are in temporay Table.
Both resultset are created separately.
Now I have Two resultset.one in commontable expression.
other in #temp table.
Now I want to merge two results.
CTE resultset has
id pdate
1 2/30/2006
#temp table has
id pdate
1 null.
Now I want update #temp table null...
HI,
I have two resultset one result set is below
id pdate
1 2006-12-30
another temptable resultset
id pdate
1 null
I want to update the temptable pdate from the previous resultsset where the result is holded in CTE.
i.e update the temptable pdate with value 2006-12-30.
can somebody...
HI,
select
ROW_NUMBER()
OVER (PARTITION BY Secid
ORDER BY secid, PriceDate desc, price) AS 'RowNumber',* from
(
select secid, PriceSource, RefPriceSource, PriceDate, Price,
Dense_Rank() over (Partition by...
Phil,
I tried using a function which gives comma separated into
table valued fun.
set @SelPorts=N'[EMBIDIV],[AMEX],[AMR]'
Select * from (select Por.ShortName, IsNull(IsNull(SM.SecDesc, rtrim(SM.SecName)), SM.PrimarySecID) as SecName,
SM.SecID,IsNull(SM.BBSectorName, 'zOthers') AssetClass...
Hi,
I am using a pivot query like below.
IN this I am using @SelPorts variable.If I include this variable I am getting error Incorrect syntax.
Without variable If I directly put values like [EMBIDIV],[AR] I am getting result.
If I assign in variable and try to use it I am getting syntax error...
HI,
I am using simple query thats two views and one table are
referred in the table.In one view I am having multiple rows so I am using distinct.my query almost takes 8mts to complete.
Below is my query.Pl somebody help me to modify the query
for efficiency.I am using sql2005
SELECT...
HI,
My trigger has the code like below.
select @valueold=symbol from sec where rating_id=(select ratingid from deleted)
select @valuenew=symbol from sec where rating_id=(select ratingid from inserted)
insert into audit(@valueold,@valuenew)
-----------------------------------------
now I...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.