Help with SQL Query

Reply

Join Date: Nov 2008
Posts: 2
Reputation: rexmont is an unknown quantity at this point 
Solved Threads: 0
rexmont rexmont is offline Offline
Newbie Poster

Help with SQL Query

 
0
  #1
Nov 27th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 58
Reputation: omrsafetyo is an unknown quantity at this point 
Solved Threads: 9
omrsafetyo omrsafetyo is offline Offline
Junior Poster in Training

Re: Help with SQL Query

 
0
  #2
Nov 28th, 2008
What have you tried so far?
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 2
Reputation: rexmont is an unknown quantity at this point 
Solved Threads: 0
rexmont rexmont is offline Offline
Newbie Poster

Re: Help with SQL Query

 
0
  #3
Dec 3rd, 2008
I achieved the result by using global arrays (in ASP) not using SQL Query.
...
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 823
Reputation: verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough 
Solved Threads: 73
verruckt24's Avatar
verruckt24 verruckt24 is offline Offline
Practically a Posting Shark

Re: Help with SQL Query

 
0
  #4
Dec 8th, 2008
I think you would need to use Stored Procedures for this. Check MySQL Stored Procedures for their usage.
Get up every morning and take a look at the Forbes' list of richest people. If your name doesn't appear.... GET TO WORK !!!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC