Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8286109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:37:51+00:00 2026-06-08T11:37:51+00:00

My application is a video game I’m writing and I’m trying to write a

  • 0

My application is a video game I’m writing and I’m trying to write a script to move my creatures around the map.
so I am trying to return unique spawn_id,posx,posy combinations (only 1 row per unique combination) It doesn’t matter which one is returned id is my key field.

SELECT id,spawn_id,posx,posy,land,movelimit,next_turn FROM `game_moblist` WHERE 1 GROUP BY spawn_id,posx,posy

so given the data

id spawn_id posx posy
1  1        55   55
2  1        55   55
3  1        110  55

the query should return rows 1 and 3 (or 2 and 3 doesn’t really matter) but not 1,2, and 3.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T11:37:52+00:00Added an answer on June 8, 2026 at 11:37 am

    You’re almost there.

    SELECT
        spawn_id, posx, posy, MIN(id) AS Id
    FROM
        game_moblist
    GROUP BY
        spawn_id, posx, posy
    

    You could also just return the list of IDs, and then join against that in other queries:

    SELECT
        MIN(id) AS Id
    FROM
        game_moblist
    GROUP BY
        spawn_id, posx, posy
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to write an application to video capture from web-cams in linux. Is
I want to write lirc plugin for totem (linux video application) and one of
I'm trying to create a simple video application(loading existing video file from ios 4
I am trying to make a peer 2 peer audio/video application, but behind NAT
I'm trying to learn to use SDL for a little game I'm writing ,
I am writing an application that exports video that I have captured (PAL SDI).
Currently in full development of a mobile application video sharing (based on PhoneGap), I
i have a web application for video uploading,In that i want to show the
I have a web application for video upload and play.The administrator can upload and
I created a video recording application with library dialog. The library dialog displays the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.