Main Tables Views Indexes Constraints Triggers Procedures Functions Packages Sanity check Index

ACS3 Data Model

Description Columns Query Constraints Triggers

EVENTS_ORDERS_STATES

Columns

NameTypeNullableInsertableUpdatableDeletableComment
ORDER_IDNUMBER(38)NNONONO 
USER_IDNUMBER(38)NNONONO 
PAID_PCHAR(1.0)YNONONO 
PAYMENT_METHODVARCHAR2(50.0)YNONONO 
CONFIRMED_DATEDATEYNONONO 
PRICE_CHARGEDNUMBER(38)YNONONO 
REFUNDED_DATEDATEYNONONO 
PRICE_REFUNDEDNUMBER(38)YNONONO 
IP_ADDRESSVARCHAR2(50.0)NNONONO 
ORDER_STATEVARCHAR2(10.0)YNONONO 

Query:

select  o.*,
o_states.order_state
from events_orders o,
 (select
 order_id,
 decode (floor(avg (decode (reg_state,
 		   'canceled', 0,
		   'waiting', 1,
		   'pending', 2,
		   'shipped', 3,
		   0))),
	     0, 'canceled',
	     1, 'incomplete',
	     2, 'incomplete',
	     3, 'fulfilled',
	     'void') as order_state
 from events_registrations
 group by order_id) o_states
where o_states.order_id = o.order_id


Generated by OraSchemaDoc, (c) Aram Kananov, 2002