0

I have to join my tables from my database, but it has multiple data (repeating data), this is my query:

select ruper from bsl_ruang b join mr_ranap_dokter d on (b.noregis=d.noregis) where d.dokter = '11111'

and the result like this;

ruper
1111
1111
2222
2233
2233
3333
3333
3333

I want to make it look like this:

ruper
1111
2222
2233
3333

how can I do that?

2 Answers 2

2

Try adding the DISTINCT keyword.

select DISTINCT ruper from bsl_ruang b join mr_ranap_dokter d on (b.noregis=d.noregis) where d.dokter = '11111'
Sign up to request clarification or add additional context in comments.

Comments

1

Use select distinct:

select distinct ruper
from bsl_ruang b join
     mr_ranap_dokter d
     on (b.noregis=d.noregis)
where d.dokter = '11111';

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.