Viewing 15 posts - 5,641 through 5,655 (of 15,381 total)
Just add
INTO SomeTableName
right before the FROM clause.
select icn,
'ADMIT' = case when MAX(case when [sequence number] = 'a' then [diagnosis code] end) IS null
then ''
else MAX(case when [sequence number]...
February 24, 2014 at 7:40 am
dannayakrahul (2/22/2014)
Thank you for your response i dont know exactly how to develop a query to that problem that is why i have kept the question with some practical data...
February 24, 2014 at 7:29 am
halifaxdal (2/21/2014)
Sean Lange (2/21/2014)
Also, you might want to look at your insert statements. They don't have all the columns listed.
Yes you are right, sorry about it, fake data.
No problem. It...
February 21, 2014 at 9:04 pm
halifaxdal (2/21/2014)
ScottPletcher (2/21/2014)
SELECT
Owner, CAST(YEAR(Quarter) AS char(4)) + 'Q' + CAST(DATENAME(QUARTER,...
February 21, 2014 at 9:03 pm
Can you explain the desired output? If this is a count of values for each period I am a bit lost. You have a total of 82 rows in the...
February 21, 2014 at 3:34 pm
ghitpro (2/21/2014)
I would like to include few columns (varchar and int data types) from same table in below query without adding in group clause, i do not want these column...
February 21, 2014 at 1:47 pm
You are updating every row because there is nothing to tie the rows together. Your logic basically says, if there are any rows that meet this criteria then update the...
February 21, 2014 at 1:43 pm
montecarlo2079 (2/21/2014)
I used the max for all of the columns...did exactly what I needed it to.
but one question, do I need to create a temp table to make...
February 21, 2014 at 9:21 am
below86 (2/21/2014)
February 21, 2014 at 7:51 am
In order to help we will need a few things:
1. Sample DDL in the form of CREATE TABLE statements
2. Sample data in the form of INSERT INTO statements
3. Expected results...
February 21, 2014 at 7:45 am
Hi and welcome to the forums. It is really difficult to figure out what you are trying to do here. You should take a few minutes and read the first...
February 21, 2014 at 7:42 am
Great job posting ddl and sample data. You stated the desired results but it is exactly the same as your sample data. What exactly are looking to do here?
February 21, 2014 at 7:39 am
SQL_Padre (2/21/2014)
SELECT * FROM DB.sys.stats WHERE user_created=1But how do I determine what tables those stats are in? with over 6000...
February 21, 2014 at 7:35 am
Jeff Moden (2/20/2014)
Sean Lange (2/20/2014)
Jeff Moden (2/20/2014)
Cast the final ouput as MONEY to get the leading zero.If that works then ...
Oh ye of little faith. 😛
SELECT TOP 10000
...
February 21, 2014 at 7:31 am
Dieselbf2 (2/20/2014)
hunchback (2/20/2014)
Here is an example without taking into consideration user types.
SELECT
t.name AS tn,
sc.*
FROM
sys.tables AS t
INNER JOIN
sys.columns AS sc
ON sc.object_id = t.object_id
INNER...
February 20, 2014 at 12:36 pm
Viewing 15 posts - 5,641 through 5,655 (of 15,381 total)