我现在有两个表
第一个表为
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的记录依然显示啊。各位帮帮忙!!
相关问答:
如下语句 :
select TimeSpan from T_Table where onlineDate = '2009-12-2'
数据库里面有符合条件的值但是查不出来
如果改成如下:
select TimeSpan from T_Table where onlineDate = '200 ......
在vs2005中引用了using System.Data.SQLite;
定义了一个连数据库连接变量public SQLiteConnection dBConn;
就报下面这个错误了.
The type 'System.Data.Common.DbConnection' is defined in an ass ......
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> ......
XML code:
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx ......
sqlite 中
CREATE TABLE table1 (
id integer primary key autoincrement,
name text default '',
[index] integer default ROWID
)
有没有类似的功能,让 index 的值默认等于id, ......