c4p0ne
01-27-2007, 10:14 AM
Hello, I would like to as a question but since I am awful at doing such things (asking questions) I will try to illustrate my question so that I don't wind up even confusing myself! It should be pretty straightforward and simple to do, I just can't figure out how as I'm new to ANY kind of SQLing.
I have a table lets say "gamenew"
________________________________
| ID | SoftKey | Valid | InUse |
````````````````````````````````
| 1 | XX123 | 1 | 1 |
````````````````````````````````
| 2 | XX124 | 1 | 1 |
````````````````````````````````
| 3 | XX125 | 1 | 0 |
````````````````````````````````
| 4 | XX126 | 1 | 0 |
````````````````````````````````
| 5 | XX127 | 1 | 1 |
````````````````````````````````
| 6 | XX128 | 1 | 0 |
````````````````````````````````
Ok so I would like to SELECT only the first "SoftKey" that is NOT in use (indicated by InUse = 0). So in other words for this specific example I would like a SELECT statement that would produce the following result:
XX125
Since XX125 is the first SoftKey in the table which is not being used. I'm not looking for multiple results like:
XX125
XX126
XX128
Thanks.
I have a table lets say "gamenew"
________________________________
| ID | SoftKey | Valid | InUse |
````````````````````````````````
| 1 | XX123 | 1 | 1 |
````````````````````````````````
| 2 | XX124 | 1 | 1 |
````````````````````````````````
| 3 | XX125 | 1 | 0 |
````````````````````````````````
| 4 | XX126 | 1 | 0 |
````````````````````````````````
| 5 | XX127 | 1 | 1 |
````````````````````````````````
| 6 | XX128 | 1 | 0 |
````````````````````````````````
Ok so I would like to SELECT only the first "SoftKey" that is NOT in use (indicated by InUse = 0). So in other words for this specific example I would like a SELECT statement that would produce the following result:
XX125
Since XX125 is the first SoftKey in the table which is not being used. I'm not looking for multiple results like:
XX125
XX126
XX128
Thanks.