Forum Replies Created

Viewing 15 posts - 826 through 840 (of 1,229 total)

  • RE: Need help tweaking a random query

    You're welcome, thanks for the feedback.

  • RE: Need help tweaking a random query

    Something like this?

    WITH RandimisedResults AS (

    select CaseNumber, AgentName,

    rn = ROW_NUMBER() OVER (PARTITION BY AgentName ORDER BY NEWID())

    from dbo.CaseSummary

    where CaseDate >= @DateFrom

    and ...

  • RE: How to find all customers that has 2 different tickets in order

    SELECT *

    FROM customers c

    INNER JOIN tickets t1 ON t1.CustId = c.CustId AND t1.[subject] = 'info'

    INNER JOIN tickets t2 ON t2.CustId = c.CustId AND t2.[subject] = 'problem'

    WHERE t2.ticketDate >...

  • RE: Concurrency

    SQLRO (5/20/2011)


    Yes. You are right.

    Paul's article shows an efficient and rigorously tested method for doing this.

  • RE: Concurrency

    SQLRO (5/20/2011)


    Hi Chris,

    Thanks for the reply.

    The records will not be actually preassigned. The records will be allocated sequentially& dynamically i.e. any top 10 records should be assigned which are...

  • RE: Concurrency

    Hi Rohit

    This looks like a scheme for selecting and using preassigned numbers for use as identity values in a table - is this the case?

    Cheers

    ChrisM

  • RE: can we use more than one join for 2 tables

    ursfriend77 (5/16/2011)


    SELECT md.number,sd.description from main_data md,sub_data sd

    WHERE 1=1

    AND md.vendor_id=sd.vendor_id(+)

    AND md.inventory_id=sd.item_id(+)

    Here i am using 2 tables main_data and sub_data, as for join rules we have to give n-1 join conditions,...

  • RE: How to find average when some of the fields contain null value?

    abhisheksrivastava85 (5/16/2011)


    Thanks a lot for reply man, but it is returning average as 0 when i am using Sign function.

    Check your data and then your code. The method works just...

  • RE: Insert decimal into varchar, but 2 pos to the left

    SkyBox (5/16/2011)


    That works, but unfortunately the data is for accounting - So rounding is not an option.

    How does the system deal with VAT?

    Is the datatype really varchar? If it is,...

  • RE: Upgrading a FoxPro db to SQL Server

    Ninja's answered the question you originally posted - it's straightforward enough to write a query which will do what you are asking.

    Expanding upon his comments, you need an intimate knowledge...

  • RE: Upgrading a FoxPro db to SQL Server

    How confident are you that a column in one table which has a name matching the pk column in another table is a foreign key?

  • RE: SQL Query

    Work on the inner query

    select stud_code,count(*) Num_Absences

    from StudAbsent

    where Absent_date between @StartDate and @EndDate

    and cmpy_code='10'

    group by stud_code

    having count(*) > 2

    until you are certain that the result...

  • RE: Today's Random Word!

    Ray K (5/13/2011)


    Brandie Tarvin (5/13/2011)


    WOTD: Edited edited

    😀

    :laugh: :laugh: :laugh:

  • RE: Order of Tables in a Query

    GilaMonster (5/10/2011)


    terrykzncs (5/10/2011)


    I know that SQL joins tables from left to right, but in what order should we join tables for the code to be most efficient?

    Any order you like....

  • RE: Loading dummy data

    Is 29,999,999,997 rows representative of the data you wish to model? Or, with 10 names to start, 99,999,999,990 rows? Is the data itself representative?

Viewing 15 posts - 826 through 840 (of 1,229 total)