Adobe Community
All community
This category
This board
Knowledge base
Users
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results forÂ
ShowÂ
 onlyÂ
|
Search instead forÂ
Did you mean:Â
Global community
Language:
Deutsch
English
Español
Français
Português
日本語コミュニティ
Dedicated community for Japanese speakers
í•œêµ ì»¤ë®¤ë‹ˆí‹°
Dedicated community for Korean speakers
Sign In
Exit
Home
ColdFusion
Discussions
where max
Home
ColdFusion
Discussions
where max
0
Upvote
where max
RyanG24
New Here
,
/t5/coldfusion-discussions/where-max/td-p/698090
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
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Dan_Bracuk
LEGEND
,
Jan 06, 2007
Jan 06, 2007
Dan_Bracuk
•
LEGEND
,
Jan 06, 2007
Jan 06, 2007
SELECT *
FROM SMS_Players_Table
WHERE PlayerID =
(select max(PlayerID) from sms_players_table)
Votes
0
Upvote
Translate
Translate
Jump to answer
3 Replies
3
Jump to latest reply
Correct answer by
Dan_Bracuk
LEGEND
,
/t5/coldfusion-discussions/where-max/m-p/698091#M65495
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
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Guest
/t5/coldfusion-discussions/where-max/m-p/698092#M65496
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
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
BKBK
Community Expert
,
/t5/coldfusion-discussions/where-max/m-p/698093#M65497
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
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Post Reply
Preview
Exit Preview
never-displayed
You must be signed in to add attachments
never-displayed
Â
Resources
Documentation
ColdFusion User Guide