|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Learn four approaches for automating Excel logic, along with advantages and disadvantages of each. Read all about it in the free whitepaper: “Tapping into Excel Logic from Java: Four Server-Based Alternatives” Download Now! |
|
#1
|
|||
|
|||
|
The following is for choosing odd and even records...
//odd records $query = "SELECT DISTINCT business_type FROM business WHERE mod(business_id,2) = 1"; //even records $query = "SELECT DISTINCT business_type FROM business WHERE mod(business_id,2) = 0"; How do I create an sql query for even record "business_type"s that are NOT "business_type"s from odd records? and vice versa? |
|
#2
|
||||
|
||||
|
smakz, could you please give an example? show a few rows, and then indicate which ones you want the query to pick
rudy |
|
#3
|
|||
|
|||
|
Quote:
Try: Code:
SELECT DISTINCT business_type FROM business WHERE mod(business_id,2) = 0 and WHERE Not mod(business_id,2) = 1 |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > query for odd/even records? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|