Reputation: 60
I have structure of table like this
id 1 2 3 4 5 6 7 8 9 10 11 ..... till 50 or 60
1 A B C D E F G H I J K
2 G H A B C D L M N O P
3 So on ..
Now i want to find whether there is value G in first row . Help !
Upvotes: 1
Views: 474
Reputation: 2515
Isn't your structure should look like this:
ValueMatrix Struc
----------------------
row_id INT
column_id INT
value VARCHAR(1)
And entered data like this:
ValueMatrix Data
----------------------
row_id column_id value
1 1 A
1 2 B
1 3 C
2 1 G
2 2 H
2 3 A
And so query to retrieve value G:
SELECT *
FROM ValueMatrix
WHERE row_id = 1 AND value='G'
Upvotes: 0