Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Database/JDBC/SQL/JDO/Hibernate » MySQL  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 一张表拆成两个以后!!!!!
hf119





发贴: 7
积分: 0
于 2007-03-29 12:34 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
请教:
在购物系统中欲将一张代售物品表分成两张表,例如将代售的宠物狗表分成两部分,(1)库存表(2)宠

物信息表。之后想在前台浏览时显示内容,包括购物信息和基本信息,前台显示宠物的数量不应受库存的

限制而减少。(因为库存表和宠物表中都有图片存在,库存中图像为本次进货的图像,宠物信息表中图像

为一般图像)当库存中有该信息时显示库存中内容并对基本信息做一个超链接,当库存中没有时该怎么做

?????

应该如何作,不胜感谢!!



作者 Re:一张表拆成两个以后!!!!! [Re:hf119]
cxp108





发贴: 363
积分: 12
于 2007-03-29 18:22 user profilesend a private message to usersend email to cxp108search all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
对LZ的问题有点模糊...
看看这样行么?

create table pets(
serial id,
bytes pic,
.....);

create table storage(
serial id,
bytes pic,
.....);

create table pet_in_storage(
int pet_id reference to pets(id),
int storage_id reference to storage(id)
);


serial 是PostgreSQL的特殊类型,就是int类型,表每加insert一条记录该字段就自动+1




flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923