Forum Replies Created

Viewing 15 posts - 226 through 240 (of 414 total)

  • RE: removing repeating fields in result

    I see

  • RE: removing repeating fields in result

    Meaning... (for a non-native English speaker ) ???

  • RE: removing repeating fields in result

    Yes, it would be easier if date and time were in the same column

    I guess your query will fail if the combination of...

  • RE: Text search Problem - part 2

    If you have the points in a table you could try this:

    CREATE TABLE Routing

    (

    RoutingString nvarchar(2000)

    )

    CREATE TABLE PointsChosen

    (

    Point nvarchar(10)

    )

    INSERT INTO Routing(RoutingString) VALUES ('A->C->F')

    INSERT INTO Routing(RoutingString) VALUES ('B->G->D')

    INSERT INTO Routing(RoutingString) VALUES ('A->D->K')

    INSERT...

  • RE: Help using cloumn name as parameters!!

    Does this work? I would imagine you would get an error when you run this proc, because the variables are not known in the dynamically executed part. On the other...

  • RE: removing repeating fields in result

    I suppose it can be done without a temp table, but that's going to be hard... Instead, try this:

     

    create table #temp

    (

    [Id] int identity(1,1),

    [OrderID] int null,

    [Customer] varchar(100) null,

    [Order Date] datetime null,

    [Update...

  • RE: Optimization - Transferr. data from 1 to another table

    Try this - the varchar(20) in the function can easily be changed to something else, e.g varchar(8000).

     

    create table T1(Ln_no int, b_flag char(1), Pkt_type int, pkt_id int)

    go

    insert T1 select 1,      'A',      ...

  • RE: Digit by digit subtraction

    I'm from Denmark.

    Post your question in another thread, then someone else will answer (I'm about to leave for now).

     

  • RE: Digit by digit subtraction

    I didn't expect it to be that fast....

    Send half of your thanks to Remi, I have stolen the idea of using the Numbers...

  • RE: Digit by digit subtraction

    You are welcome - please post the result of your test...

    Also note that if your numbers always have the same length - 36...

  • RE: Digit by digit subtraction

    I think I have a faster (set-based) solution (the creation of the Numbers table is stolen from one of Remi's posts):

    IF Object_id('Numbers') > 0

    DROP TABLE dbo.Numbers

    GO

    CREATE TABLE dbo.Numbers (PkNumber int identity(1,1), dude...

  • RE: Convert Rows to column

    I have posted a different solution below, which creates and uses a second table named testtable2. Please let me know if this performs better.

     

    create table testtable(#Tr int, Name varchar(100), Perc...

  • RE: Stuck in fetching 2 top queries result simultaneoulsly pls. Help

    This perhaps (and I forgot "desc" in my first query):

    select top_state, stu_name from tresult t

    where stu_name in (select top 2 stu_name from tresult where top_state = t.top_state order by tot_marks...

  • RE: Stuck in fetching 2 top queries result simultaneoulsly pls. Help

    I this what you are looking for (in the top 5 case):

    select top_state

    from

    (

    select top 5 top_state, sum(tot_marks) as tot, max(tot_marks) as m from tresult

    group by top_state

    order by tot, m

    )

    dt

  • RE: Convert Rows to column

    This suggestion requires that the rows of your table are unique:

    create table testtable(#Tr int, Name varchar(100), Perc int)

    go

    insert into testtable select 100,  'John', 25

    insert into testtable select 100,  'Harry',...

Viewing 15 posts - 226 through 240 (of 414 total)