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 6988461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:05:04+00:00 2026-05-27T19:05:04+00:00

I want to extract two types of data which is store in the same

  • 0

I want to extract two types of data which is store in the same column of my table and display it in two column. I have do many search and do many test but nothing works.
It could be easy to do…

This is my table:

| id  | field_id | user_id | value            | 
| 175 |       65 |       3 | 48.8984188201264 | 
| 173 |       65 |       2 | 37.9841493       | 
| 177 |       65 |       4 | 48.8440603       | 
| 179 |       65 |       5 | 48.8407529       | 
| 174 |       66 |       2 | 23.7279843       | 
| 176 |       66 |       3 | 2.25568230749569 | 
| 178 |       66 |       4 | 2.3730525        | 
| 180 |       66 |       5 | 2.3213214        | 

I want to display latitude (Field_id=65) in one field and longitude (field_id= 66) in another one by joining on the user_id.

Two select:

select value as longitude 
from wp_bp_xprofile_data 
where field_id=66; 

select value as latitude 
from wp_bp_xprofile_data 
where field_id=65;

| longitude        |
| 23.7279843       |
| 2.25568230749569 |
| 2.3730525        |
| 2.3213214        |

| latitude         |
| 48.8984188201264 |
| 37.9841493       |
| 48.8440603       |
| 48.8407529       |

How I can display this data in one table with two column?

Thanks

  • 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-05-27T19:05:05+00:00Added an answer on May 27, 2026 at 7:05 pm

    Bassam’s answer is all well and good, but it’s not exactly the most efficient thing in the world. You can simplify your query like so:

    select
        t1.user_id,
        t1.value as latitude,
        t2.value as longitude
    from
        wp_bp_xprofile_data t1
        inner join wp_bp_xprofile_data t2 on
            t1.user_id = t2.user_id
    where
        t1.field_id = 65
        and t2.field_id = 66
    

    This way, you’re not pulling in subqueries, and your query is a little clearer, at least to me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table containing two columns in SQL that I want to extract
I have a database and i want to extract result based on two table
Suppose that I have two data types Foo and Bar. Foo has fields x
I want to extract information from two columns of textfile. Currently I have my
I want to extract two consecutive words starting from each word in a string.
I have the two columns in my table within Mysql. The Columns are Amount
How can I extract two fields from a given file named.conf? I want the
I want to extract all strings between two characters (parentheses). $string = "blah blah
I want to extract information from three tables which are linked by certain ids
At run time I want to input two types of datatype, double and string.

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.