If any portion of the itinerary is booked in X, Q, G, or N, the entire trip will not earn any mileage.
This is exactly in line with SQ's KrisFlyer mileage accrual policy.
BTW, I just learned that Q is used for SQ's heavily discounted BKK-x/SIN-o/NRT-x/SIN-BKK. BKK agents are well aware of this no-mileage accrual policy but one should ask beforehand, I think.
A regular discount ticket is sold under Y, thus no problem for gaining miles.