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.
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...
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...
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...
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...
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...
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?
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.