Forum Replies Created

Viewing 15 posts - 151 through 165 (of 683 total)

  • RE: best way to remove duplicates when no primary key or date present

    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

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: how to count number of rows in a table column

    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...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Clash :Min() vs Max()

    karthikeyan (4/30/2008)


    I have modified your query little

    select 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...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Clash :Min() vs Max()

    This query...

    select *, Year * 100 + Month as YearAndMonth from #t1

    ...gives this output...

    /*

    PRID Month Year ...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Clash :Min() vs Max()

    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

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Clash :Min() vs Max()

    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

    ...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Dates

    jpettigrew (4/30/2008)


    Hello All,

    I need to create stored procedure that will output information created 3

    months after the record was created. For example: if the stored procedure was

    run today or based...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Job fails with SETUSER error

    Use the other post! This one is the duplicate! Leave it alone... 😉

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Job fails with SETUSER error

    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...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Job fails with SETUSER error

    Duplicate http://www.sqlservercentral.com/Forums/Topic490818-359-1.aspx

    Please don't cross-post.

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Join issue

    Jack Corbett (4/25/2008)

    Got me again! 😀

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Join issue

    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...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: how to count the number of characters in a postgres database

    This site is for SQL Server - you need a different site. Try this one...

    http://www.dbforums.com/forumdisplay.php?forumid=81

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: select records, change a value and insert into same table

    Like this?

    insert tableA

    select col1, col2, col3, ... ,'MHCIRC1208' from tableA where bspid like '%CI11%'

    Or is 'MHCIRC1208' derived somehow?

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: How to build a query, consisting of some subqueries which need parameters?

    Jack Corbett (4/25/2008)

    I hate it when that happens 😀

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

Viewing 15 posts - 151 through 165 (of 683 total)