Viewing 15 posts - 8,056 through 8,070 (of 8,731 total)
Something like this?
SELECT *
FROM @Client cl
WHERE EXISTS( SELECT 1
FROM @ValidDates vd
WHERE cl.ValidDate BETWEEN vd.StartDate AND vd.EndDate)
June 12, 2013 at 4:48 pm
Lynn Pettis (6/12/2013)
Luis Cazares (6/12/2013)
As easy as
SELECT UserID,
MAX(Email) Email
FROM MyTable
If you need a specific email, you need to define the priority.
Yep, easy except...
June 12, 2013 at 3:59 pm
As easy as
SELECT UserID,
MAX(Email) Email
FROM MyTable
GROUP BY UserID --Edited post to add this line
If you need a specific email, you need to define...
June 12, 2013 at 3:34 pm
Don. (6/12/2013)
This script seems to do what I want with the demo data.
Select top 100 *
From CONTSUPP
Where RECTYPE = 'C'
AND ( CONTSUPREF...
June 12, 2013 at 2:56 pm
opc.three (6/12/2013)
June 12, 2013 at 2:39 pm
A similar approach to Sean's iTVF.
WITH Codes(code) AS(
SELECT *
...
June 12, 2013 at 2:33 pm
Maybe a recursive CTE can help you. Note that I'm including the sample data in a CTE and you might not need it when you apply the solution.
WITH...
June 12, 2013 at 1:28 pm
That's because the first script is expecting a character after and a character before the LC, that's why I added trailing and leading spaces to the column. Try adding a...
June 12, 2013 at 5:25 am
Everyone makes mistakes, so continue to participate in this forum, that way we all win and learn. 😉
June 11, 2013 at 4:07 pm
Deque (6/11/2013)
Luis Cazares (6/11/2013)
Learner44 (6/11/2013)
I guess using wildcard character..like
select * from student where studentname like 'LC%' ;
is this the one what you are looking for?
You have the right idea,...
June 11, 2013 at 3:45 pm
Sean Lange (6/11/2013)
Or you could use the DelimitedSplit8K.
I was going to suggest that as well 😀
June 11, 2013 at 3:30 pm
You might miss some desired results if you have other delimiters such as tabs or slashes.
Be sure to add them between the brackets[] or to replace them with a space...
June 11, 2013 at 3:24 pm
Learner44 (6/11/2013)
I guess using wildcard character..like
select * from student where studentname like 'LC%' ;
is this the one what you are looking for?
You have the right idea, but you're not...
June 11, 2013 at 3:06 pm
Sean Lange (6/11/2013)
sqlfriends (6/11/2013)
we can also use table inline funciton for update statement, what is the syntax of that?
No, you cannot update a function. A table valued function or a...
June 11, 2013 at 1:45 pm
You should use something like this
SELECT spa.StudentID, spa.AddressID, itv.streetApt, ama.city, ama.state FROM stuPropertyAddress spa
INNER JOIN dbo.addMasterAddress ama ON spa.addressID=ama.addressID
CROSS apply dbo.FNC_GetStreetApt2(spa.StudentID) itv
WHERE spa.StudentID = @studentID
June 11, 2013 at 1:11 pm
Viewing 15 posts - 8,056 through 8,070 (of 8,731 total)