SELECT TOP 1 * FROM asr_loc_mast WHERE loc_sts IN ('O')
#{loc}
ORDER BY
row1 DESC
SELECT TOP 1 * FROM asr_loc_mast WHERE loc_sts IN ('O') AND loc_no IN
#{loc}
ORDER BY
row1 ASC
SELECT a.*
from(
SELECT * FROM asr_loc_mast WHERE loc_sts = 'O' AND row1 = 1
UNION ALL
SELECT * FROM asr_loc_mast WHERE loc_sts = 'O' AND row1 = 8 and bay1 > 7
UNION ALL
SELECT * FROM asr_loc_mast WHERE loc_sts = 'O' AND row1 = 12
UNION ALL
SELECT * FROM asr_loc_mast WHERE loc_sts = 'O' AND row1 = 23
UNION ALL
SELECT * FROM asr_loc_mast WHERE loc_sts = 'O' AND row1 = 18 AND (bay1 = 1 or bay1 = 3 )
) a ORDER BY a.lev1,a.bay1 ASC
SELECT * FROM asr_loc_mast WHERE loc_sts != 'O' AND loc_no in
#{loc}
SELECT * FROM asr_loc_mast WHERE lev1 = #{lev}
select *
from asr_loc_mast
where 1=1
and loc_sts='O'
and loc_type1 = #{locType1}
and row1 >= #{rowBeg}
and row1 <= #{rowEnd}
and bay1 >= #{bayBeg}
and bay1 <= #{bayEnd}
and lev1 >= #{levBeg}
and lev1 <= #{levEnd}
and loc_no not in ('0100101')
order by loc_sts desc ,lev1 asc,bay1 asc
select * from asr_loc_mast
where loc_sts in ('O')
and loc_type3 = #{locType3}
and loc_type1 = #{locType1}
ORDER BY row1,bay1,lev1
select * from asr_loc_mast
where loc_sts in ('O')
and loc_type3 = #{locType3}
and loc_type1 = #{locType1}
and lev1 = #{lev}
ORDER BY row1,bay1,lev1
SELECT * FROM asr_loc_mast
WHERE loc_sts IN ('O')
AND loc_no IN
#{loc}
ORDER BY
row1 ASC
select * from asr_loc_mast
where loc_no = #{locNo}
update asr_loc_mast set loc_type2 = #{locType2}
where (row1 >= #{startRow} and row1 <= #{endRow})
and (bay1 >= #{startBay} and bay1 <= #{endBay})
and (lev1 >= #{startLev} and lev1 <= #{endLev})
select * from asr_loc_mast lm
left join asr_loc_detl ld
on lm.loc_no = ld.loc_no
where ld.matnr is null and lm.loc_sts = 'F'
update asr_loc_mast set loc_sts = 'S'
where row1 >=1 and row1 <= 16
and bay1 in(21,22,23,37,38,39,56,57,58)
and lev1 >= 3 and lev1 <= 10
and loc_sts = 'O'