Viewing 15 posts - 781 through 795 (of 2,894 total)
nigelrivett (12/11/2012)
Depends on your data as to whether it is any better
SELECT AA.[Country Code],
SUM(extendedamount) AS Amount
FROM dbo.AllActiveAuthorised AS AA
WHERE dispatcheddate >= CAST('20121101'...
December 11, 2012 at 9:29 am
You cannot force the order as per list in IN.
You should consider re-factoring your query.
One of the ways:
SELECT t.*
FROM @T t
JOIN (VALUES (1,'XYZ'),(2,'AAA'),(3,'PQR')) lst(rn,name)
ON lst.name= t.name
ORDER by lst.rn
December 11, 2012 at 7:11 am
sanket kokane (12/10/2012)
please don't stop posting your questions..Just follow some rules ..People are happy to help you here
Don't take anything Personally 🙂
Especially such default rude and non-constructive answers from...
December 11, 2012 at 6:09 am
Phil Parkin (12/11/2012)
WolfgangE (12/11/2012)
December 11, 2012 at 6:05 am
I'm glad to help. You are welcome!
December 11, 2012 at 6:04 am
The problem with your posted sample is lack of details. Would be really great if you could provide better DDL. What is PK of your table? What really makes your...
December 11, 2012 at 4:48 am
Sean Pearce (12/11/2012)
ALTER PROCEDURE [dbo].[usp_delete]@tablename sysname,
@pid int,
@pidname varchar(10)
AS
DECLARE @sql NVARCHAR(MAX),
@Params NVARCHAR(MAX);
SELECT@sql = 'DELETE FROM [' + @tablename + '] WHERE ' + @pidname + ' = @pid;',
@Params = '@pid INT';
EXEC...
December 11, 2012 at 3:32 am
nigelrivett (12/11/2012)
select idfrom tbl
where type in ('A','B')
group by id
having count(distinct type) <> 2
That is good, but only will work if one of the types is missing...
December 11, 2012 at 3:04 am
Provided sample is very basic, but should give an idea how to do what you want:
declare @sample table (id int, [type] char(1))
insert @sample select 1,'A'
insert @sample select 1,'B'
insert @sample...
December 11, 2012 at 3:03 am
Hope that following should help you:
SELECT tf.EmpNo, tf.ChkDate
FROM filesTA tf
WHERE tf.ChkDate BETWEEN '20121001' AND '20121005'
AND NOT EXISTS (SELECT 1 FROM SalaryDay2 sd2
...
December 10, 2012 at 11:16 am
...
In short, I need officially accepted "SQL Architecture diagram 2012".
I'm just guessing, but if such one would exist, google search would return it straight away...
December 4, 2012 at 5:39 am
Continuous discussion on this thread, kind of shows that people has nothing much to do...
:hehe:
I do agree with few different points of different posters...
I guess if such question is asked...
December 4, 2012 at 5:11 am
... does it do one condition and then drop to the CASE...END statement after satisfying one of the conditions?
That is correct.
December 3, 2012 at 3:35 am
Why are you trying to use dynamic sql. It's look like you need full outer join:
SELECT ISNULL(t.Column_Name, v.Column_Name) AS Column_Name
...
December 3, 2012 at 2:36 am
Viewing 15 posts - 781 through 795 (of 2,894 total)