sQL – C17&C12

eMmm kadang klo lagi query2 kadang masih suka lupa, jadi sebenernya postingan ini cuma buat catetan kecil yang kapan aja bisa dibukaπŸ˜€.

[C17-High Usage]

select * from tableA
where (field1 =’1024′ and field2 between ‘730’ and ‘749’)
or (field1 =’750′ and field2 between ‘730’ and ‘749’)
or (field1 = ‘2048’ and field2 between ‘950’ and ‘1000’)
or (field1 =’2560′ and field2 between ‘950’ and ‘1000’)

dan ternyata bisa digabung jd begini loh, barusan dikoreksi ma bpk guru chiank,makasih yah…πŸ˜‰

select * from tableA
where (field1 in (‘1024′,’750’)and field2 between ‘730’ and ‘749’) or
(field in (‘2048’, ‘2560’) and field2 between ‘950’ and ‘1000’)

[C17 – Quota Alert]

select * from tableA
where (field1 =’1024′ and field2 >= ‘750’)
or (field1 =’750′ and field2 >= ‘750’)
or (field1 = ‘2048’ and field2 >= ‘1001’)
or (field1 =’2560′ and field2 >= ‘1001’)

[C17-No Usage]

select * from tableA where field1=’0′

[C12]

select a.field1,a.field2,a.field3
from tableA a, tableB b, tableC c
where a.field1=b.field1 and a.field1 not in (select field1 from tableC)

eMmm segitu dulu deh, lanjut nanti lagiπŸ˜€. Spesial thx buat chiankπŸ˜‰

4 thoughts on “sQL – C17&C12

  1. chiank says:

    mungkin wherenya bisa digabung seperti ini..

    where (field1 in (‘1024’,’750″) and field2>= ‘750’) or

    dst dst

  2. #Joesatch :
    Belajar dunk, aQ juga lagi belajar nie semangat semangat !!! caiyo..!!! πŸ˜‰

    #Chiank :
    Wah makasih koreksinya, ntar aQ tambahin, koreksi dari pa guru ChiankπŸ˜›

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s