공부하던 도중 ..


CREATE TABLE easy_drinks
(
 drink_name VARCHAR(20), main VARCHAR(20), amount1 DEC(3,2), second VARCHAR(20), amount2 DEC(3,2), directions VARCHAR(100)
);


INSERT INTO easy_drinks
VALUE
('Blackthorn' , 'tonic water' , 1.5 , 'pineapple juice' , 1 , 'stir with ice, strain into cocktail glass with lemon twist'),
('Blue Moon' , 'soda' , 1.5 , 'blueberry juice' , 0.75 , 'stir with ice, strain into cocktail glass with lemon twist'),
('Oh My Gosh' , 'peach nectar' , 1 , 'pineapple juice' , 1 , 'stir with ice, strain into shot glass'),
('Lime Fizz' , 'Sprite' , 1.5 , 'lime juice' , 0.75 , 'stir with ice , strain into cocktail glass'),
('Kiss on the Lips' , 'cherry juice' , 2 , 'apricot nectar' , 7 , 'serve over ice with straw'),
('Hot Gold' , 'peach nectar' , 3 , 'orange juice' , 6 , 'pour hot orange juice in mug and add peach nectar'),
('Lone Tree' , 'soda' , 1.5 , 'cherry juice', 0.75 , 'stir with ice, strain into cocktail glass'),
('Greyhound' , 'soda' , 1.5 , 'grapefruit juice' , 5 , 'serve over ice, stir well'),
('Indian Summer' , 'apple juice' , 2 , 'hot tea' , 6 , 'add juice to mug and top off with hot tea'),
('Bull Frog' , 'iced tea' , 1.5 , 'lemonade' , 5 , 'serve over ice with lime slice'),
('Soda and It' , 'soda' , 2 , 'grape juice' , 1 , 'shake in cocktail glass, no ice');


테이블을 만들고 값들을 넣었습니다.

문제는  amount1 DEC(3,2) 이 필드의 값들이 1.5 ,  3, 2 등등 있는데 1.5가 2로 출력되어 나옵니다.

실수(소수값)값으로 나오지않고 정수값으로 2.0 이 출력되는데 왜그런가요?

뒤에있는  amount2 DEC(3,2) 는 제대로 실수값으로 출력되는데 앞의  amount1 DEC(3,2)는 값중 1.5가 2.0으로 출력되어 나옵니다..


알려주세요..ㅠㅠ 

No. Subject Author Date Views
Notice SQL강좌: 챗GPT와 함께 배우는 SQL Server 무료 강좌 목차와 소개 (2023년 9월 업데이트) 코난(김대우) 2023.08.18 824
Notice Python 무료 강좌 - 기초, 중급, 머신러닝(2023년 6월 업데이트) 코난(김대우) 2021.01.01 1592
9936 일별 회원가입 통계를 하고싶습니다.. [5] umtaeng 2017.08.03 2942
9935 특정유저가 특정 링크드 서버만 SELECT 가능 하게 가능 할까요? 군고구마 2017.08.03 5029
9934 SQL 2008 서버 접속 오류의 질문 한현 2017.08.03 5587
9933 전화번호가 속한 내용들은 모두 조회하고 싶습니다 [4] 문상연 2017.08.02 3234
9932 Merge,hash 조인걸때, 비동등조건 [4] 헬로우파이썬 2017.08.02 3454
9931 쿼리 도움 요청드려요. [2] 수수리 2017.08.02 4249
9930 차등백업이나 트랜잭션 로그백업에 사용할 풀백업본 질문입니다. [2] tempest 2017.07.31 5620
9929 비클러스터 인덱스를 잡았는데 클러스터 인덱스를 scan하는 이유는 왜그런가요? [3] 바다낚시꾼 2017.07.26 2529
9928 프로시저 실행 중 table lock 문의 [2] 톡히슈터 2017.07.19 2894
9927 MSSQL 2012 행을 열로 변경 [3] l1j2e3 2017.07.17 3015
» my sql 정말 쉬운 질문입니다..(DEC관련..) 유스탁키오관 2017.07.15 2116
9925 로그인 계정에 대한 질문 입니다. icham 2017.07.14 2590
9924 쿼리 질문드립니다 ㅠ [3] 브라미 2017.07.14 2434
9923 DELETE 관련 질문입니다 [2] 코코 2017.07.14 2117
9922 함수 먹힌 column 에 인덱스 추가하는방법? [2] 노잼호 2017.07.13 2636
9921 like에 대해서..? [4] 문상연 2017.07.13 2536
9920 postgresSQL 다중 행 쿼리질문(내용수정) [3] 궁금해서알고싶어요 2017.07.11 1978
9919 프로시저내 트랜젝션 문의드립니다. [2] 톡히슈터 2017.07.10 2564
9918 2005에서 2008로 업그레이드 하려고 합니다. 엘제이 2017.07.10 2593
9917 뜬금없이MSSQL이실행중이나 실행이 안됩니다. [1] 김영환_281520 2017.07.10 4259





XE Login