Viewing 15 posts - 151 through 165 (of 345 total)
Jeff Moden (8/23/2011)
______________________________________________________________________________
How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
August 23, 2011 at 4:08 pm
shew (8/23/2011)
______________________________________________________________________________
How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
August 23, 2011 at 9:02 am
Your query that defines the cursor cleans up to this
SELECT
BudgetUnit,
POChartOfAccount,
'Encumbrance' ShortDescription,
SUM(UnitPrice * UnitsOrdered) ExtendedPrice
FROM
Requisition r
INNER JOIN
PurchaseOrder po on r.POID = po.POID
INNER JOIN
RequisitionLineItems rli ON...
______________________________________________________________________________
How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
August 17, 2011 at 3:54 pm
One thing at a time, you don't want a sub select here
--Obtain the next control number
...
______________________________________________________________________________
How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
August 17, 2011 at 12:28 pm
nadabadan (8/15/2011)
troe_atl (8/15/2011)
______________________________________________________________________________
How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
August 15, 2011 at 10:04 pm
troe_atl (8/15/2011)
I have a store procedure that has a summary query that return 4 rows but only inserts 2 rows into my table. Please take a look at the...
______________________________________________________________________________
How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
August 15, 2011 at 3:52 pm
nested query derived table
qualify the derived table too, look how it makes it easier to see where the column is coming from
SELECT h.invoice_id,
...
______________________________________________________________________________
How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
August 12, 2011 at 6:56 am
Probably talking about a CTE.
http://msdn.microsoft.com/en-us/library/ms190766.aspx
______________________________________________________________________________
How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
August 11, 2011 at 3:22 pm
With winash's suggestions and also aliasing the companies table, your query becomes this
SELECT h.Invoice_id AS Invoice_Id,
...
______________________________________________________________________________
How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
August 11, 2011 at 10:24 am
You're saying "assign" and "populate" but you're only running a select. Are you trying to update?
UPDATE
C
SET
C.Warehouse_Aisle =
CASE BS.Warehouse_Segment
WHEN 'Gourmet' then 1
WHEN 'Commercial' then 1
WHEN 'Consumer' then 2
END
FROM...
______________________________________________________________________________
How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
August 3, 2011 at 11:34 am
If you guys need a sub, I'd like to play. 🙂
______________________________________________________________________________
How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
July 27, 2011 at 9:22 am
bopeavy (7/13/2011)
Ignoring any potential logic problems, the syntax error is caused by not naming the derived table, like so
Select SUM(L_VALUE), SUM(B_VALUE) FROM (SELECT DISTINCT ID,C_NO FROM MYTABLE GROUP BY...
______________________________________________________________________________
How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
July 14, 2011 at 9:49 am
Ignoring any potential logic problems, the syntax error is caused by not naming the derived table, like so
Select SUM(L_VALUE), SUM(B_VALUE) FROM (SELECT DISTINCT ID,C_NO FROM MYTABLE GROUP BY ID,C_NO)...
______________________________________________________________________________
How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
July 13, 2011 at 2:13 pm
Or if you want the results in a table format, you could try this:
select asset_year,
sum(case when asset = 'A' then 1 else 0 end) A,
sum(case when asset = 'B' then...
______________________________________________________________________________
How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
July 13, 2011 at 7:36 am
Viewing 15 posts - 151 through 165 (of 345 total)