MAX( cast(to_date(from_unixtime(unix_timestamp(yourdate , 'MM-dd-yyyy'))) as date))
编辑:在您的评论中,您提到您需要获取最长日期的帐户详细信息。您可以使用此选项。
SELECT a.id,
b.contract,
CAST (
TO_DATE (
from_unixtime (unix_timestamp (b.date, 'MM-dd-yyyy'))) AS DATE)
AS MAX_DATE
FROM acct a JOIN customer b ON (b.partyid = a.offerid)
WHERE CAST (
TO_DATE (
from_unixtime (unix_timestamp (b.date, 'MM-dd-yyyy'))) AS DATE) IN
( SELECT
MAX (
CAST (
TO_DATE (
from_unixtime (unix_timestamp (b.date, 'MM-dd-yyyy'))) AS DATE))
FROM acct a JOIN customer b ON (b.partyid = a.offerid)
WHERE b.contract = 200427747 );
1条答案
按热度按时间acruukt91#
尝试
编辑:在您的评论中,您提到您需要获取最长日期的帐户详细信息。您可以使用此选项。