Forum Replies Created

Viewing 15 posts - 18,481 through 18,495 (of 18,926 total)

  • RE: INNER JOIN brings a duplicate record

    Welcome to my world.

  • RE: INNER JOIN brings a duplicate record

    This is how I would try to pinpoint the problem :

    take the query and remove 1 table from join at the time... eventually you'll be getting only 1 record....

  • RE: Top N across groupings

    yes

  • RE: Top N across groupings

    you could do something like this but I'm sure there's a faster way to return that query... this takes 30 secs to run on 30 groupings / 10k rows)... however...

  • RE: Inserting rows using cols returned from syscolumns?

    You can test this script on the northwind db and see how long it runs... shouldn't take more than a few secs.

    Also you could modify the foreach proc to run...

  • RE: Inserting rows using cols returned from syscolumns?

    It's not dumb... but it's actually pretty hard to do.

    I got this from microsoft but I lost the original link some time ago... this is my slightly modified version :...

  • RE: Memo field

    then you'll have to scan the text everytime the user types a character and count how many lines there are... but that can cause problems if it's a realy...

  • RE: Memo field

    You'll have to loop through the text and count how many vbCrlF are in it. You'll have to code this in the keypress or something like that... and start...

  • RE: Order By using a variable

    I'm not 100% sure about this. But from my experience it seems that all the expressions in the case must return the same datatype. So it's either all...

  • RE: Big Nasty Mess, please help

    Here's an exemple on how to filter out your select so you get all the data you need in only 1 select... but also no more data than you need.

    SELECT...

  • RE: Select with inner joins becomes slower with new data

    I can think of 2 things :

    1 - index are fragmented : you can run sp_updatestats to update the statistics of the table.

    You should also look up DBCC INDEXDEFRAG...

  • RE: what can be the query??

    Select C.cust_id, C.customer_email, COUNT(*) as PurchasesQty, SUM(P.AMOUNT) as PurchasesAmount from dbo.customer C LEFT OUTER JOIN dbo.Purchase P on C.cust_id = P.Cust_id

    if PurchasesAmount returns null then use

    ISNULL(SUM(AMOUNT)) as PurchasesAmount instead.

  • RE: UDF using the REPLACE function

    Happy that you found that funny... and I just made myself a nice base for a future function.

    But I'm sorry to tell you that I know no other work around...

  • RE: 3 table Join Question

    Everybody needs a little cefeine at this hour on a friday.

    HTH

    Brain shut off sequence has begun. Happy week-end.

  • RE: 3 table Join Question

    Select Name, Sum(Laps) As TotalLaps

    From

    (

    Select Name, Laps

    From Tom

    Union All

    Select Name, Laps

    From Dick

    Union All

    Select Name, Laps

    ...

Viewing 15 posts - 18,481 through 18,495 (of 18,926 total)