Viewing 15 posts - 5,026 through 5,040 (of 10,144 total)
kapil_kk (3/18/2013)
((select min(VoucherNo) VoucherNo, TransactionID from GV_Voucher
group by TransactionID
--order by VoucherNo asc
)
union all
select max(VoucherNo)VoucherNo, TransactionID from GV_Voucher
group by TransactionID
--order by VoucherNo desc
)
select * from cte
Thsi will...
March 18, 2013 at 5:58 am
This should get you started:
-- Inline tally from Jeff Moden et al.
DECLARE
@LastBookNo INT = 23,
@LastPageNo INT = 80,
@BooksToInsert INT = 2,
@PagesPerBook INT = 10
;WITH E1(N) AS (
...
March 18, 2013 at 4:57 am
bhushan_juare (3/15/2013)
I have done some modifications in my script.. and I am getting correct result set but their are some (im.MATNR As ITEM) entries who are not present...
March 18, 2013 at 2:31 am
The #temp table isn't strictly necessary but may improve performance:
;WITH MassagedData AS (
SELECT Company,
MIN_Number = MIN(Number),
MAX_Number = MAX(Number),
rn = ROW_NUMBER() OVER(PARTITION BY Company ORDER BY MIN(Number))
FROM (
SELECT Company,...
March 15, 2013 at 7:53 am
What version of SQL Server are you connected to?
March 15, 2013 at 3:27 am
L' Eomot Inversé (3/14/2013)
Stefan Krzywicki (3/14/2013)
I'd be happy if DST was year-round again.
That would be alright here, but I'd hate that if I were in England in wintertime.
I've been to...
March 15, 2013 at 2:34 am
Looks like whatever is causing the inconsistency has been lost in the simplification process. Try this:
-- Query 3:
SELECT a.col1, a.col2, b.col3
FROM tab1 a
FULL OUTER JOIN (
SELECT
col1,
col2,
col3--,
--row_number() over(partition by...
March 15, 2013 at 2:26 am
mkarthikeyan.mohan (3/15/2013)
Dear friends,
i build the stored procedure was much more logic, each and every column having calculation.That was handled by function. each an every function also having loops.i was doing...
March 15, 2013 at 2:16 am
TheSQLGuru (3/14/2013)
March 14, 2013 at 7:38 am
sqlnyc (3/12/2013)
I'm attempting to optimize some code that I was just handed, and I'm not exactly sure if what I want to do is possible. ...
I'd check that it's doing...
March 14, 2013 at 7:31 am
GilaMonster (3/14/2013)
Yes.
ALTER TABLE <table name> ADD <column name> BIT NOT NULL DEFAULT 0;
Better.
March 14, 2013 at 7:07 am
bhushan_juare (3/14/2013)
Thanks for reply One thing i wanna ask you Do I need to add same logic for condition 2..?
Because what I am getting is one side results...
March 14, 2013 at 7:02 am
ALTER TABLE MyTable ADD NewColumn BIT
GO
UPDATE MyTable SET NewColumn = 0
GO
ALTER TABLE MyTable ADD CONSTRAINT NewColumnDefault DEFAULT 0 FOR NewColumn
March 14, 2013 at 6:59 am
Incidentally, your WHERE clause turns this LEFT JOIN SALES_DATA sd
ON so.VKBUR = sd.VKBUR into an INNER JOIN.
The same happens with table VBAP inner joined to SALES_DATA. If you...
March 14, 2013 at 6:15 am
Something like this?
SELECT --DISTINCT -- not needed, covered by GROUP BY
year(sd.FKDAT) As YEARWISE_DATA,
so.vkbur As MARKET,
so.bezei As NAME,
sd.kunrg As PARTY,
cm.NAME1 As PARTY_NAME,
im.MATNR As...
March 14, 2013 at 6:10 am
Viewing 15 posts - 5,026 through 5,040 (of 10,144 total)