• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

where max

New Here ,
Jan 06, 2007 Jan 06, 2007

Copy link to clipboard

Copied

Hi i need a query which selects only the max ID, I tried below but get an error any ideas?

<cfquery name="GetNew" datasource="#application.ds#">
SELECT *
FROM SMS_Players_Table
WHERE PlayerID = MAX(PlayerID)
</cfquery>
TOPICS
Advanced techniques

Views

311

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jan 06, 2007 Jan 06, 2007
SELECT *
FROM SMS_Players_Table
WHERE PlayerID =
(select max(PlayerID) from sms_players_table)

Votes

Translate

Translate
LEGEND ,
Jan 06, 2007 Jan 06, 2007

Copy link to clipboard

Copied

SELECT *
FROM SMS_Players_Table
WHERE PlayerID =
(select max(PlayerID) from sms_players_table)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 06, 2007 Jan 06, 2007

Copy link to clipboard

Copied

<cfquery name="GetNew" datasource="#application.ds#">
SELECT Max(PlayerID)
FROM SMS_Players_Table
</cfquery>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 07, 2007 Jan 07, 2007

Copy link to clipboard

Copied

LATEST
<cfquery name="GetNew" datasource="#application.ds#">
SELECT Max(PlayerID) as maxID
FROM SMS_Players_Table
</cfquery>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation