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

  • Home
  • SEARCH
  • 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 6533865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:10:53+00:00 2026-05-25T10:10:53+00:00

How to join two table data in sqlite database

  • 0

How to join two table data in sqlite database

  • 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-25T10:10:54+00:00Added an answer on May 25, 2026 at 10:10 am

    if (sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK) {

        //const char *sql = "select TaskId,TaskName,StartDate,DueDate,Status,CategoryId from ToDo";
    
        const char *sql = "SELECT TaskId,TaskName,StartDate,DueDate,Status,ToDo.CategoryId,CategoryName FROM ToDo LEFT OUTER JOIN Category ON ToDo.CategoryId=Category.CategoryId";
    
        sqlite3_stmt *selectstmt;
        if(sqlite3_prepare_v2(database, sql, -1, &selectstmt, NULL) == SQLITE_OK) {
    
            while(sqlite3_step(selectstmt) == SQLITE_ROW) {
    
                NSInteger primaryKey = sqlite3_column_int(selectstmt, 0);
                ToDo *toDoObj = [[ToDo alloc] initWithPrimaryKey:primaryKey];
                toDoObj.taskName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectstmt, 1)];
                toDoObj.startDate = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectstmt, 2)];
                toDoObj.dueDate = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectstmt, 3)];
                toDoObj.status  = sqlite3_column_int(selectstmt, 4);
                toDoObj.categoryId = sqlite3_column_int(selectstmt, 5);
                toDoObj.category = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectstmt, 6)];
                toDoObj.isDirty = NO;
    
                [appDelegate.todoArray addObject:toDoObj];
                [toDoObj release];
            }
        }
    
    }
    else
        sqlite3_close(database);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing a join on two tables. One is a user's table and
I've got two models, joined by a Has and Belongs To Many join table.
I need to do a join across two different database servers (IPs 10.0.0.50 and
Two snippets of MySQL: SELECT * FROM annoyingly_long_left_hand_table LEFT JOIN annoyingly_long_right_hand_table ON annoyingly_long_left_hand_table.id =
I'm porting a process which creates a MASSIVE CROSS JOIN of two tables. The
Say I have two tables I want to join. Categories: id name ---------- 1
I need to join two binary files with a *.bat script on Windows. How
Is it possible to join two sockets? For example, if a process is acting
Is it possible to join two classes without specified mapping between them (using Criteria
A cross join performs a cartesian product on the tuples of the two sets.

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.