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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:41:00+00:00 2026-05-28T00:41:00+00:00

how can i select only one column from mnesia? I can select onle column

  • 0

how can i select only one column from mnesia?
I can select onle column in ets table with this code:

ets:match(AllData_TableId, {'_', '$1','_',','_'},3),

I need something similar for mnesia.

Thank you.

  • 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-28T00:41:00+00:00Added an answer on May 28, 2026 at 12:41 am

    In the examples found here: http://en.wikibooks.org/wiki/Erlang_Programming/Using_mnesia, look at how the author uses the function mnesia:match_object/1, and the consider reading it here more http://www.erlang.org/doc/man/mnesia.html#match_object-1

    However, we are advised to design our mnesia databases and/or tables in a way to avoid the use of this method. This is because it makes mnesia traverse the entire table looking for a match.

    What you need is qlc

    -include_lib("stdlib/include/qlc.hrl").
    
    select(Q)->
        case mnesia:is_transaction() of
            false -> 
                F = fun(QH)-> qlc:e(QH) end,
                %% mnesia:transaction(F);
                mnesia:activity(transaction,F,[Q],mnesia_frag);
            true -> qlc:e(Q)
        end.
    
    -record(book,{title,isbn,price,category}).
    
    book_title({book,ISBN})->
        select(qlc:q([X#book.title || X <- mnesia:table(book),X#book.isbn == ISBN])).
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made the following search script but can only search one table column
I want to select a row (that appears multiple times) from a table ONLY
I need to select the counts from two tables that share a common column
how can I use Zend_Db_Select to directly select from a subquery (derived table)? See,
I've a simple table with only one column UrzadSkarbowyWojewodztwo that I'm trying to attach
I have a table var with some rows but only one column of type
When I execute a sql statement like Select ..., I can only see ...100%
I can select all the distinct values in a column in the following ways:
I can select using or with the sql statement select f.userid, f.friend_userid from friends
I'm using a SELECT statement in T-SQL on a table similar to this: SELECT

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.