Viewing 15 posts - 241 through 255 (of 287 total)
I tend to use upper, but either upper or lower I'm fine with as long as it is consistant. 🙂
July 7, 2009 at 1:22 pm
Here is one guess. You might be able to emilenate the join between AAA and BBB, depends on your data...INSERT CCC
SELECT *
FROM
(
SELECT T2.*
FROM BBB AS B
INNER JOIN
(
SELECTB.ID, MAX(B.Date) AS MaxDate
FROM...
July 6, 2009 at 3:48 pm
First you should look at: http://www.datamodel.org/NormalizationRules.html
That will give you the basics. I'm not sure if this is for a class, personal enrichment or work. But, if you plan on continuing...
July 1, 2009 at 1:13 pm
Nuts (6/30/2009)
HiThanks for your reply.
I tried your query but there are still few patient IDs appearing in the result who have been on both type of Drugs..
I do not...
July 1, 2009 at 11:41 am
I would suggest using a trigger for a temproal constraint.
I assume you have additonal constraints for BeginDate < EndDate?
July 1, 2009 at 11:35 am
Is the column just a date or does it also include the format (mm/dd/yy)?
July 1, 2009 at 11:21 am
I wasn't sure if you were looking for all combinations of Customers that meet that percentage or just starting with the min number or.???
At anyrate, I just used a simple...
July 1, 2009 at 10:52 am
SQL has ranking functions that people use for sequence numbers (ROW_NUMBER, RANK, DENSE_RANK). But, I'm not aware of anything that allows you to specify a one PK for mutiple tables.
Do...
July 1, 2009 at 10:30 am
You cannot guarantee in what order SQL will evaluate your conditions so the CONVERT might happen before or after the ISNUMERC:WHERE id_type = 'MR'
AND isnumeric(result_value) = 1 -- Issue
AND (resulted_test_desc...
June 30, 2009 at 4:57 pm
Here is another one for just for people on A and not B for a given year:SELECT
A.[Calendar year],
A.Quarter,
COUNT(*) AS Total_Patients_on_Just_A
FROM
(
SELECT *
FROM [MainTable]
WHERE [Drug name] = 'typeA'
) AS A
LEFT OUTER JOIN
(
SELECT...
June 30, 2009 at 4:45 pm
If you can fix your names now you should remove the spaces. But, here ya go.
SELECT
A.[Calendar year],
A.Quarter,
COUNT(*) AS Total_Patients_on_Aand_B
FROM
(
SELECT *
FROM [Main Table]
WHERE [Drug name] = 'typeA'
) AS A
INNER JOIN
(
SELECT *
FROM...
June 30, 2009 at 4:42 pm
To build on what Grant and others have said. Exchanges are, in general, more expensive. Since we are talking in a SQL forum, I'll assume that you mean as it...
June 30, 2009 at 12:38 pm
If you are interested in a set-based solution you might try giving us DDL, sample data and expected output in addition explaining what you are actually trying to do.
I'm not...
June 29, 2009 at 3:26 pm
Here is an article writen by Peso that compares several methods:
June 29, 2009 at 3:05 pm
Viewing 15 posts - 241 through 255 (of 287 total)