Viewing 15 posts - 151 through 165 (of 683 total)
Another option...
delete a from
(select *, row_number() over (partition by CityName, Zip, Description order by CityName) as x from SC) a
where x > 1
April 30, 2008 at 11:33 am
Nicole (4/30/2008)
Hi all,can any one send me the query to find the number of rows for a particular column,
thanks
You have a terminology problem here, so it's hard to understand...
April 30, 2008 at 10:13 am
karthikeyan (4/30/2008)
I have modified your query littleselect PRID, min(Year * 100 + Month)/100 as Year,
min(Year * 100 + Month)%100 as Month,
From #t1 group by PRID
It is working perfectly.
Yep - that...
April 30, 2008 at 8:37 am
This query...
select *, Year * 100 + Month as YearAndMonth from #t1
...gives this output...
/*
PRID Month Year ...
April 30, 2008 at 8:34 am
Here's another way...
select PRID, YearAndMonth / 100 as Year, YearAndMonth % 100 as Month
from (select PRID, min(Year * 100 + Month) as YearAndMonth from #t1 group by PRID) a
April 30, 2008 at 7:52 am
For a start, you can just take what you've done and nest the query you were putting into #A1
select #A1.PRID,Y,Min(Month)
from (
select PRID,Min(Year) as Y
...
April 30, 2008 at 7:49 am
Use the other post! This one is the duplicate! Leave it alone... 😉
April 25, 2008 at 10:59 am
You'll get a reply, don't worry. The trouble with posting it twice is that someone might spend time trying to help you, only to discover you'd already been helped, or...
April 25, 2008 at 10:45 am
Duplicate http://www.sqlservercentral.com/Forums/Topic490818-359-1.aspx
Please don't cross-post.
April 25, 2008 at 10:33 am
The characters are probably some other 'invisible' characters - like tabs or returns.
Use something like this to figure out what the ascii values are...
select distinct ascii(substring(MyColumn, number, 1)) from myTable...
April 25, 2008 at 10:30 am
This site is for SQL Server - you need a different site. Try this one...
April 25, 2008 at 9:44 am
Like this?
insert tableA
select col1, col2, col3, ... ,'MHCIRC1208' from tableA where bspid like '%CI11%'
Or is 'MHCIRC1208' derived somehow?
April 25, 2008 at 9:42 am
Jack Corbett (4/25/2008)
I hate it when that happens 😀
April 25, 2008 at 9:35 am
Viewing 15 posts - 151 through 165 (of 683 total)