ang MS SQL 2000 server installer mo run ba sa windows 2003 standard edition server OS?
 
			
			 Re: SQL 101
 Re: SQL 101
				ang MS SQL 2000 server installer mo run ba sa windows 2003 standard edition server OS?
 
			
			 Re: SQL 101
 Re: SQL 101
				SELECT topics.ID_TOPIC as id, subject as name, body FROM smf_messages as messages, smf_topics as topics WHERE topics.ID_FIRST_MSG = messages.ID_MSG AND topics.ID_BOARD = ORDER BY name
 
			
			 Re: SQL 101
 Re: SQL 101
				CREATE OR REPLACE FORCE VIEW MEDICINE_STOCKS_LEDGER
(ORDERING, MEDICINE_CODE, TRAN_DATE, TRAN_BY, TRAN_TYPE,
TRAN_DESC, TRAN_NO, ADD_QUANTITY, DEDUCT_QUANTITY, BALANCE_QUANTITY)
AS
SELECT dense_rank() over (PARTITION BY medicine_code ORDER BY tran_date, tran_type, tran_no) ordering,
medicine_code,
tran_date,
tran_by,
tran_type,
DECODE(tran_type, '1_RC', 'RECEIVE', '2_DS', 'DISPENSE', '3_AD', 'ADJUST') tran_desc,
tran_no,
add_quantity,
deduct_quantity,
SUM(NVL(add_quantity, 0) - NVL(deduct_quantity, 0)) over (PARTITION BY medicine_code ORDER BY tran_date, tran_type, tran_no) balance_quantity
FROM (
SELECT rcmd_medi_code medicine_code,
mdrr_received_on tran_date,
mdrr_received_by tran_by,
'1_RC' tran_type,
rcmd_mdrr_tran_no tran_no,
rcmd_quantity add_quantity,
NULL deduct_quantity
FROM received_medicines,
medicine_rr
WHERE mdrr_tran_no = rcmd_mdrr_tran_no
UNION ALL
SELECT dsmd_medi_code medicine_code,
cnlg_date tran_date,
cnlg_nurse tran_by,
'2_DS' tran_type,
cnlg_tran_no tran_no,
NULL add_quantity,
dsmd_quantity deduct_quantity
FROM dispensed_medicines,
consultation_logs
WHERE cnlg_tran_no = dsmd_cnlg_tran_no
UNION ALL
SELECT admd_medi_code medicine_code,
msad_adjusted_on tran_date,
msad_adjusted_by tran_by,
'3_AD' tran_type,
msad_tran_no tran_no,
admd_add_quantity add_quantity,
admd_deduct_quantity deduct_quantity
FROM adjusted_medicines,
medicine_stock_adjustments
WHERE msad_tran_no = admd_msad_tran_no
);
 Re: SQL 101
 Re: SQL 101
				I'm unsticking this. It doesn't seem important enough to clutter up the stickied posts. PM me with objections and insults if you disagree.
 
			
			
 Re: SQL 101
 Re: SQL 101
				hi tanan
dugay2x o taud2x na gyud unta ko gusto mukat-on ug mulambo pero hangtud karon gamay ra ug daginuton pa kaayo akong nakat-unan mahitungod aning SQL
mao ni ang mga links nga akong natampo kaniadtu pa dinhi sa istorya:
matching two table(s) with the same fields but different contents by sql
https://www.istorya.net/forums/progra...tents-sql.html
learning (my)sql 101
https://www.istorya.net/forums/progra...sql-101-a.html
adding new column in TABLE using sql
https://www.istorya.net/forums/progra...using-sql.html
nag-post lang ko daan ani nga thread kay in the coming days kani na sab akong pagakat-onan sa akong mga kaalam (at least ma-review ninyo pud tanan unsa akong background when it comes to programming .. char. heheh)
just an over view unsa akong mga future inquiries, gi-unsa ninyo pagsugod o pagkahimong-imba aning SQL?
matsalams
| Similar Threads | 
 |