-
A tricky query needed
I have two rows in my table myTable
myTable
Row Name Flag1 Flag2 Number
1 Primary Y N 1234
2 Secondary N Y 4444
I need a query which needs to fetch a single row like this
Row Name Number
1 Primary 4444
The condition is like this
The resultant record should pick the Name iff the Flag1 is Y and the Number iff the Flag2 is Y.
Note: If I use 'Flag1 and Flag2' in my where clause I get don't get any records... If I use 'Flag1 or Flag2' I get two records but I want only one
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|