943,903 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Unsolved
  • Views: 830
  • MySQL RSS
Nov 27th, 2008
0

Help with SQL Query

Expand Post »
Hello all,

lets say i have a table like this which has 3 columns and 3 rows;

-----------------------------------------------------------+
COLUMN_A.....|.....COLUMN_B.....|...COLUMN_C |
.........X............|...........X............. |.........X...........|
.........X............|...........-...............|.........X...........|
..........-............|...........-...............|.........X...........|
-----------------------------------------------------------+

So, now i have an input like; (user submits a form)
----------------------------------------------------+
......X............|...........X............|..........-.......|
----------------------------------------------------+

now; the first column of row#1 is X so it is same as the input. the 2nd column of row#1 is X so it is also same as the input. and obviously third column of row#1 is not "-" so it is different. So, this row's score is "2".

with same point of view 2nd row's score is "1" (input is matching with only COLUMN_A.)

and finally third row is completely different from input. All columns are differs from input. so its score is "0".

Finally the question is; how can i build this "scoresheet" with a fast sql query.

Thanx in advance.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rexmont is offline Offline
2 posts
since Nov 2008
Nov 28th, 2008
0

Re: Help with SQL Query

What have you tried so far?
Reputation Points: 13
Solved Threads: 9
Junior Poster in Training
omrsafetyo is offline Offline
58 posts
since Apr 2008
Dec 3rd, 2008
0

Re: Help with SQL Query

I achieved the result by using global arrays (in ASP) not using SQL Query.
...
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rexmont is offline Offline
2 posts
since Nov 2008
Dec 8th, 2008
0

Re: Help with SQL Query

I think you would need to use Stored Procedures for this. Check MySQL Stored Procedures for their usage.
Reputation Points: 485
Solved Threads: 89
Posting Shark
verruckt24 is offline Offline
944 posts
since Nov 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: Using the COUNT function with a subquery in SQL
Next Thread in MySQL Forum Timeline: Creating a database





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC