Viewing 15 posts - 1,891 through 1,905 (of 3,957 total)
SQLSACT (3/4/2013)
Quick question - Why doesn't this work?:
SELECT name, purchase_date, product, quantity
,n = ROW_NUMBER() OVER (PARTITION BY name ORDER BY...
March 4, 2013 at 1:36 am
Didn't Todd Fifield just write an article on this?
March 4, 2013 at 1:28 am
Lynn beat me to it by a minute or two, but here's another way:
create table #Class
(code int,
CName varchar(10))
create table #Amount
(code int,
Currency char(3),
Amount float)
insert into #Class
select 1 , 'ASD' UNION...
March 4, 2013 at 1:15 am
Not really possible with a GROUP BY because you want two columns off the row with the max date, so use a window function:
create table #table1
(name nvarchar(50), purchase_date datetime,product...
March 4, 2013 at 12:58 am
Something like this should get you started:
CREATE TABLE #MyDates
(SLN INT, ID INT, StartDate DATETIME, EndDate DATETIME
,Duration AS (DATEDIFF(minute, StartDate, EndDate))
...
March 3, 2013 at 8:55 pm
Jeff Moden (2/27/2013)
dwain.c (2/27/2013)
February 27, 2013 at 8:57 pm
A couple of quick points:
1. Since you're a first time poster, you should understand that to get better, faster and more accurate help you should follow the first link in...
February 27, 2013 at 5:53 pm
Revenant (2/27/2013)
Over six months and no post... No one drinking beer any longer?
I've been too inebriated on beer to post! :w00t::hehe::hehe:
February 27, 2013 at 5:25 pm
ChrisM@Work (2/27/2013)
@dmarz96, it's much easier to see what you are trying to do, now that I've seen both...
February 27, 2013 at 4:50 am
Sean Lange (2/25/2013)
February 26, 2013 at 11:49 pm
polkadot (2/26/2013)
--DDL for Merge/Update statement
MERGE companyassignments T
USING
(SELECT ua.userid, eu.username, ua.companyname
FROM userassignments ua
JOIN existingusers eu on
eu.userid = ua.id
where companyname in (
SELECT companyname
FROM existingcompanies)) as S
on t.username = s.username
and t.companyname...
February 26, 2013 at 11:00 pm
Jeff Moden (2/26/2013)
dwain.c (2/26/2013)
Like this?Looks like it. Heh... we make a hell of a tag team. I'll flush out the requiremments, you write the code. 🙂
Yeah, aren't we...
February 26, 2013 at 8:36 pm
Like this?
WITH PriorResults (HPROP, STYPE, SVALUE, NSFFee, SecDepIntRate)
AS (
SELECT 240, 'DDEPOSITINTEREST', 0, NULL, 3000.0000
UNION ALL SELECT 240, 'NSFFee', 0, 50.0000, NULL
)
SELECT...
February 26, 2013 at 6:45 pm
wolfkillj (2/26/2013)
daglugub 60457 (2/25/2013)
February 26, 2013 at 6:40 pm
It can also be done using OUTER APPLY, which could be especially handy if you need to return additional columns from each of the 4 tables.
;WITH AllComputers AS (
...
February 26, 2013 at 6:06 pm
Viewing 15 posts - 1,891 through 1,905 (of 3,957 total)