我现在有两个表
第一个表为
id title content
1 34234 234234
第二个表为
id Tcontent time tab1ID
1 嘉陵江 2009-1-1 1
怎样把表二的time加入表一 然后select排出time的升序
我连接两表都搞晕了 请大大们帮帮忙
SQL code:
select *
from 第一个表 a ,第二个表 b
where a.id=b.tab1ID
order by b.time
SQL code:
select *
from 第一个表 a inner join 第二个表 b on a.id=b.tab1ID
order by b.time
select *
from A1 a inner join A2 b on a.id=b.tab1ID
order by b.time
select a.*,b.time
from a , b
where a.id=b.tab1ID
order by b.time
select a.*,b.time
from 表1 a inner join 表2 b on a.id=b.tab1id
order by b.time
以上方法可以查出 但是如果表2没有记录 查询的结果是空
有没有办法查出如果b.time为空自动加上“空” 然后表1的记录依然显示啊。各位帮帮忙!!
相关问答:
C# code:
System.Data.SQLite.SQLiteConnection conn = new SQLiteConnection(@"acs.db");
try
{
conn.Open();
}
......
sqlite的空值查询怎么写,能者得分
select * from tt where f1 is null
select * from yourTable where col is null;
SQL code:
sqlite> create table Aoqun (id int primary key,col1 int);
sqlite> ......
最简单的问题。也有点郁闷。
我想创建一个数据库
我现在只有一个sqlite3.exe文件。
我使用的方法是双击这个文件
使用的命令为:
sqlite3 f:\a.db 回车
可是结果却显示为
...>
sqli ......
小弟 弄点东西可是调用 sqlite3_prepare 这个函数 select 就好使 只要 改变数据库 的就不行 比如insert 之类的 谁来帮个忙啊 请问这是什么原因 啊 用 c 去实现的
你用的什么工具啊?
把你自己的代码发 ......
刚入门 想实现新闻表新闻置顶的功能
select * from web_news order by id desc limit 0,6
web_news 表里有TOP列 怎样让TOP列记录为1的为置前 各位大大们帮帮忙 分不多 请包涵!!
order ......