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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:40:14+00:00 2026-05-29T08:40:14+00:00

I am struggling with a MYSQL query – I have 2 tables : Table

  • 0

I am struggling with a MYSQL query – I have 2 tables :

Table 1 (info) containing UID, first_name, last_name.
Table 2 (card) containing UID, pic .

What I am trying to do is get all results into an array:

WHERE UID IN '$ids' AND LEFT(last_name,1) = '$letter' ORDER BY last_name, first_name ASC

I figured an INNER JOIN so my current code is:

("SELECT UID, first_name, last_name, pic FROM 
    (SELECT info.first_name,info.last_name,card.pic FROM info 
     INNER JOIN card ON info.UID=card.UID)
  WHERE LEFT(last_name,1) = '$letter' ORDER BY last_name, first_name ASC")

This is producing the following error though:

‘Every derived table must have it’s own alias’.

Am I going about this the right way with inner join, and how do I give the derived table an alias? Thanks in advance!

  • 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-29T08:40:15+00:00Added an answer on May 29, 2026 at 8:40 am
    select b.UID, g.first_name, g.last_name, b.pic
    from user_data.general_info g
    inner join user_data.Bcards b on g.UID = b.UID
    where LEFT(g.last_name, 1) = '$letter'
    order by g.last_name, g.first_name asc
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi i'm struggling to write a particular MySQL Join Query. I have a table
I have the same tables as in this question: MySql query over many-to-many relationship
I have a reasonably complex MySQL query being run on another developer's database. I
I'm struggling with 3 tables I'm trying to join and exclude certain results. Basically
I have two set of arrays in different MYSQL table. This what I want
I'm struggling with some PHP/MySQL code. I am reading from 1 table, changing some
I have a MySQL table set up using phpMyAdmin which you can view in
I have a MySQL database containing a user's country and whether they are an
I am struggling to update my MySQL database. This is what I have written:
I'm really struggling with a MySQL query that I'm really hoping someone can help

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.