Viewing 15 posts - 5,191 through 5,205 (of 10,144 total)
Try this, Wayne:
USE Occupancy
;WITH BookingsToUpdate AS (
SELECT
*,
Seq = ROW_NUMBER() OVER (ORDER BY Booking_Skey)
FROM Bookings
)
SELECT
Seq,
Booking_Skey,
BookingNumber = 'B' + RIGHT('0000000' + CAST(Seq AS VARCHAR(8)),8),
AnotherBookingNumber = 'B' + RIGHT('0000000'...
February 21, 2013 at 3:21 am
wafw1971 (2/20/2013)
February 20, 2013 at 6:18 am
wafw1971 (2/20/2013)
Its alright I have figured it out:...
DwainC already figured it out for you:
SELECT
ArrivalDate,
BookingDate = DATEADD(day,
-(1 + ABS(checksum(NEWID())) % 90),
ArrivalDate)
FROM Bookings
ORDER BY ArrivalDate
February 20, 2013 at 5:46 am
DROP table #empl
CREATE TABLE #empl
(
row_id int,
ename varchar(120),
job varchar(120),
sal varchar(100)
)
INSERT #empl VALUES
('4','ram','IT','60000'),
('4','ram','IT','60000'),
('4','ram','IT','60000'),
('4','ram','IT','60000');
WITH OrderedData AS (
SELECT row_id, ename, job, sal,
rn = ROW_NUMBER() OVER(PARTITION BY row_id, ename, job, sal...
February 20, 2013 at 12:54 am
akberali67 (2/18/2013)
Chris, thanks again for all the help. Truly thanks doesnt do it but from the bottom of my heart I can not thank you for the help.
Gosh - thanks!...
February 19, 2013 at 1:00 am
-- Collect the matches
SELECT l.ID ;
FROM LARGE l ;
INNER JOIN small s ;
ON s.ID <> l.ID ;
AND LARGE.Z5 = small.z5 and Large.ln = small.ln and Large.fn = small.fn...
February 19, 2013 at 12:57 am
Paul White (2/18/2013)
ChrisM@Work (2/11/2013)
February 18, 2013 at 2:59 am
sqldba_newbie (2/16/2013)
February 18, 2013 at 1:21 am
Sachin Vaidya (2/14/2013)
Your response definitely shows a path to move ahead, thanks a lot for that.
But on the other side, it was very rude. It will discourage people from...
February 15, 2013 at 1:09 am
Another way:
SELECT abc.*
FROM dbo.abc abc
WHERE NOT EXISTS (SELECT 1 FROM dbo.xyz)
OR abc.id IN (SELECT ID FROM dbo.xyz)
February 13, 2013 at 6:56 am
mpdillon (2/12/2013)
...since it didn't use the lookup table, I was not able to fully implement it....
Which lookup table, Pat? The article (and the discussion) should provide you with all the...
February 12, 2013 at 5:55 am
ScottPletcher (2/11/2013)
For best performance,Cluster the table by
LAST_DAY_OF_MONTH
and not the dopey identity column. If you still need the identity (??), you can leave it as the nonclustered pk.
+1
February 12, 2013 at 12:57 am
The option you have commented out will never be selected because there's an option before it in the CASE construct which will:
CASE
WHEN mb.name LIKE...
February 11, 2013 at 9:54 am
You're welcome. Thank you for the feedback.
February 11, 2013 at 9:52 am
gparamasivamit (2/11/2013)
i need answer
42 of course. Doesn't everybody know this now?
February 11, 2013 at 9:49 am
Viewing 15 posts - 5,191 through 5,205 (of 10,144 total)