General discussion

Locked

SQL Script

By fauzanf ·
Hello My Friends,

I'm a new member in TechRepublic.
I have a question, about SQL Script. I'm Using SQL Server 2008.

I have one table, contain 3 Fields... It's ID,STATUS,JUDGE

1. ID -- AutoNumber
2. STATUS -- Only 3 Words... PASSED, HOLD, REJECTED
3. JUDGE -- BOOLEAN (TRUE/FALSE)

I want to know the SQL Script, if i have two criteria to filter.

1. Show All records that STATUS IS NOT PASSED
2. Show All records that STATUS IS PASSED AND JUDGE IS TRUE.

SQL Script for No. 1:
SELECT * FROM TableName WHERE Status<>'PASSED'

SQL Script for No. 2:
SELECT * FROM TableName WHERE Status='PASSED' AND Judge=TRUE

How to combine the two scripts above into one script...???

Need help and advice.


Regards,
Fauzan :)

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Oh, please!

by JackOfAllTech In reply to SQL Script

This is so elementary it doesn't deserve an answer.

Have you never heard of Google?

Collapse -

Needs a comma

by santeewelding In reply to Oh, please!

After, "of".

Written version, since, not oral, unless you try and, have failed, at the latter.

Collapse -

Comment...

by fauzanf In reply to Oh, please!

Hello My Friend,

Thanks for your comment... :)

Collapse -

Don't fret

by santeewelding In reply to Comment...

We hold our own to standards high.

I come from a place where murder in the first and most odious degree is prosecuted wherein every "i" is crossed and every "t" dotted, lest the prosecutor lose the faith of those who, in turn, prosecute him.

Collapse -

Alright

by fauzanf In reply to Don't fret

Alright, i understand that...

So, anybody can answer my question?

Collapse -

Daniel

by santeewelding In reply to Alright

Presses on into a den of lions.

Collapse -

ok

by Shellbot In reply to SQL Script

Your just looking to return both sets of data in the same result set?
If so:

Select * from tablename
where (Status <> 'passed') OR
(Status = 'Passed' and judge=true)

Or are you meaning something else?

Back to Networks Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums