Forum Replies Created

Viewing 15 posts - 4,546 through 4,560 (of 5,502 total)

  • RE: How to return rows with same value in one column and not same value in another column

    Untested, since there are no data provided to test against:

    ;with cte as

    (

    select UserID

    from table

    group by UserID

    having count(*) >1

    )

    select table.* from table inner join cte on cte.UserID = table.UserID

  • RE: Need advice to design table

    You might think about using a calendar table.

    Search this site for details.

    An example can be found for instance here .

    You could also have a look at the link in...

  • RE: Please Reply. I need a stored procedure based on some conditions.

    Just for the record of it:

    the solution shahid posted has been provided by ramireddy at social.msdn .

  • RE: Import Multiple flat files with different structure into a single table

    Would you mind sharing some more details regarding the file structure and if those files are located in the same folder or have a "patterned" file name?

    Also, would you share...

  • RE: SQL Query Help

    Something along those lines?

    Note: The CASE statement is used to set a "flag" depending on the mode and then simply adding the "Flags"...

    SELECT T1.ItemName, COUNT(T1.ItemName) AS TOTAL,

    sum(case WHEN Mode='AAA' THEN...

  • RE: Pivot Result

    Does "a column" means ONE column including the comma separated list?

    If you need the data in a table with each value in its own column then please have a look...

  • RE: Pivot Result

    Do you need the output o be one column each or a list of comma separated values?

  • RE: sp needed

    This will take several steps:

    Step 1: convert the string into a table

    Step 2: separate the value of the first item

    Step 3: Build a cross tab (see the related link in...

  • RE: OpenXML : If a node exists

    To get the columns and the corresponding values you could use the following code (using XQuery and your sample data):

    DECLARE @in_values xml

    SET @in_values = '<root><column_name><node_a>value1</node_a><node_b>value2</node_b></column_name></root>'

    SELECT DISTINCT

    T.n.value('localname[1]', 'varchar(100)')...

  • RE: Convert DateTime to MMDDYY

    To even confuse a little more, 010409 might be as well interpreted as April 9th 2001...

    I probably would even include the format in the string and truncate it where needed...

  • RE: OpenXML : If a node exists

    TcW_1978 (1/7/2010)


    but I can't know if the field node_c needs to be updated to null or if the node_c doesn't exist in my xml string...

    Is there a way I...

  • RE: OpenXML : If a node exists

    What xml element/attribute describes the column name?

    Your examle is only using data from a column. There is nothing indicating any relationship between node_a and localname, meaning: How do you know...

  • RE: IsNumeric not working

    It's hard to tell without sample data.

    Please provide table def, sample data to play with and expected results as described in the first link in my signature.

  • RE: Create one record for each in quotient

    arun.sas (1/6/2010)


    SELECT SKU,Qty,PKQTY

    FROM

    (select slno from

    (select 1 slno

    union all

    select 2

    union all

    select 3

    union all

    select 4

    union all

    select 5)as X) a

    You don't...

  • RE: Compare consecutive rows and accumulate time

    Would you please post some sample data from EventLog so we have something to test against?

    Also, please post your expected output.

    It seems like this function is a little oversized for...

Viewing 15 posts - 4,546 through 4,560 (of 5,502 total)