Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by NikkieG

  1. NikkieG

    Picking Row with earliest date for each person

    Loving the shocked icon - I really didn't want to resort to Excel but my manager was sure I would have to! You are an absolute star - thank you so much.
  2. NikkieG

    Picking Row with earliest date for each person

    Hi, Sorry if this is a really simple question, but it's been driving me mad all morning. I have a table where the data is in 4 columns: Person ID, Appointment Date, Postcode & Estate in which that postcode lies. I have several rows for each person because the postcode & estate change from...
  3. NikkieG

    SQL - Duplicate Rows

    Thanks so much bertrandkis - I had had a play with both bits of code and, whilst the second one was giving me slightly odd answers when I had triple rows (I got one too many results, presumably from the 'T1.Tariff < T2.Tariff' part of the join - it joined row 1 to 2, 1 to 3 and then 2 to 3), the...
  4. NikkieG

    SQL - Duplicate Rows

    Thanks Borislav - this does answer my original question, but still only brings back the minimum value of the group of three, whereas in cases of three records I need all but the most expensive returning. In your example I would need rows 1 & 2 returning for UniqueId '200510254081332436501', yet...
  5. NikkieG

    SQL - Duplicate Rows

    Sorry, I forgot to say that using select UniqueID, min(Tariff) from dbo.BHT_QA8D_EXTRACT_Dec05 group by UniqueID works for pairs, but I can't figure out what to do with rows where there are three values. I realise that SQL is doing what I ask it to, but for those where there are three records...
  6. NikkieG

    SQL - Duplicate Rows

    Hi! I'm hoping someone can help with this as I am at the end of my tether! I have a table that contains patient data and each record has a cost attached to them. By looking at the patient ID, the date they were admitted and their treatment I have created a unique ID that can identify those...
  7. NikkieG

    Using results from a temporary column to calculate next column

    Thanks - you're a star - the populations do change, but that works perfectly! Could I push my luck and pick your brain to find out if you know of a way to get SQL to return all age bands, even if there are some with no cases?
  8. NikkieG

    Using results from a temporary column to calculate next column

    I am trying to get SQL to help me with age standardisation and confidence intervals, by 5 year age bands. I can get the data in to 5 year age bands, but as I use the count(*) function to get the number of cases I am finding I can't manipulate this column further. From the cases I need to...

Part and Inventory Search

Back
Top