如何从SQL数据库某列? [英] how to get certain column from SQL database?

查看:101
本文介绍了如何从SQL数据库某列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用该行独特的列ID我的sql数据库得到一定的列。
例如我的活动...

I would like to get a certain column from my sql database using the rows unique column id. For example my activity is...

public class bookLookup extends Activity {
  WebView webView; 
  private DbAdapter mDbHelper; 
  Override public void
  onCreate(Bundle savedInstanceState){ 
    super.onCreate(savedInstanceState);

    setContentView(R.layout.book_browser);
    webView = (WebView)findViewById(R.id.webkit);

    Intent myIntent = getIntent();
    myIntent.getExtras.getLong("id");

我怎么能采取从另一个活动这个ID唯一ID,并从该行的唯一ID获得某列?

How could i take this id unique id from another activity and get a certain column from the unique id for the row?

推荐答案

您与您的数据库传递一个查​​询,如SELECT ID FROM表,其中YOURCONDITION

you have to pass one query with your DB like "SELECT ID FROM TABLE WHERE YOURCONDITION"

这篇关于如何从SQL数据库某列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆