Joined: 19 Dec 2011
Online Status: Offline
Posts: 50
Topic: SQL Query! Posted: 28 Jan 2014 at 5:19am
Hello
I am a complete novice when it comes to SQL so apologies if this is either really easy or completely impossible!
For a customer (e.g. 12345678) there may be multiple test scores held. I want to be able to identify particular test types out of multiple test records and then within this subset I need to identify the highest ranking based on values of my choice. For example if 12345678 has 5 test records I want to identify where type A and B exist (although there may also be different values within the records) and from A and B rank A higher than B. There may also be multiple records of the same type. Is this something I could use SQL to identify as I need to be able to do a count and sum of this data.
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Posted: 06 Feb 2014 at 12:43pm
There's really not enough information in your question to give you a good response. Do you know what the tables this data is in look like (e.g., the fields and types)? Do you know which field the "type" is in and what fields need to be ranked? Also, what type of database are you connecting to (MS SQL Server, Oracle, etc.) Are you going to display customers who only have BOTH type A and type B, or do you want to display all customers and do the sums and counts for just those types?
There's probably a way to do this in SQL, but without more info I can't give you a good answer for how to do this.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum