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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:11:30+00:00 2026-05-22T12:11:30+00:00

I got the following 2 tables in my app’s database Table1: FTSProfile ———– suggest_intent_data_id

  • 0

I got the following 2 tables in my app’s database

Table1:

FTSProfile
-----------
suggest_intent_data_id
suggest_shortcut_id
CELL_ID
NAME
_id

Table2:

FTSCell
-----------
suggest_intent_data_id
KEY_LAC
suggest_shortcut_id
_id
KEY_MCC
KEY_CID
KEY_MCC

And I want to perform a left join on the tables, with KEY_CID = KEY_CELL_ID. Every thing seems fine until i want to get the FTSCell._id and cast it as _ID in the resultant table. I used the SQLiteQueryBuilder to help building the query:

SQLiteQueryBuilder builder = new SQLiteQueryBuilder();
    builder.setTables(FTS_VIRTUAL_TABLE_PROFILE+" LEFT JOIN "+FTS_VIRTUAL_TABLE_CELL+" ON "+FTS_VIRTUAL_TABLE_CELL+"."+DataCellQuery.KEY_CID+"="+FTS_VIRTUAL_TABLE_PROFILE+"."+DataProfileQuery.KEY_CELL_ID);
    builder.setProjectionMap(mColumnMap_CombinedTable);
    Cursor cursor = builder.query(mDatabaseOpenHelper.getWritableDatabase(), columns, selection, selectionArgs, null, null, null);
    if (cursor == null) return null;
    else if (!cursor.moveToFirst()) {
        cursor.close();
        return null;
    }   
    return cursor;

and here is my HashMap being used:

private static HashMap<String, String> buildColumnMap_CombinedTable() {
        HashMap<String,String> map = new HashMap<String,String>();
      for (String key: DataCellQuery.KEYS) map.put(key, key);
      map.put(BaseColumns._ID, "rowid AS " + FTS_VIRTUAL_TABLE_CELL+ "."+BaseColumns._ID);
      map.put(SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID, "rowid AS " + SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID);
      map.put(SearchManager.SUGGEST_COLUMN_SHORTCUT_ID, "rowid AS " + SearchManager.SUGGEST_COLUMN_SHORTCUT_ID);
      return map;
        }

The query is perfect if I do not get the _id from the Cell table, but I need that in my code. How can I get rid of that??? The following error message is what I get…

 05-19 15:56:05.054: ERROR/AndroidRuntime(7772): Caused by: android.database.sqlite.SQLiteException: near ".": syntax error: , while compiling: SELECT rowid AS FTSCell._id, KEY_MCC, KEY_MNC, KEY_CID, KEY_LAC FROM FTSProfile LEFT JOIN FTSCell ON FTSCell.KEY_CID=FTSProfile.CELL_ID WHERE (NAME="PX9RKTPYW4")
  • 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-22T12:11:31+00:00Added an answer on May 22, 2026 at 12:11 pm

    The syntax is:

    select table.field as name, ...
    

    not name as table.field.

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

Sidebar

Related Questions

I've got the following tables: User Basic Data (unique) [userid] [name] [etc] User Collection
I've got the following two tables (in MySQL): Phone_book +----+------+--------------+ | id | name
I've got the following 2 tables: ingredients (id, name) ingredient_prices (id, ingredient_id, price, created_at)
I've got a SQL Server database with the the following tables: Client (ClientID, ClientName)
I've got the following tables: Products: id, name, ... Products_in_Categories id, category_id, product_id Categories
I've got the following tables in a CMS database (SQL Server 2008) for a
I've got the following problem: I have two tables: (simplified) +--------+ +-----------+ | User
I've got the following table: patients id name diagnosis_id What I need to do
I've got a Rails app that'll be sitting on top of a legacy database
I've got a web app I'm building in ASP.NET that has the following security

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.