Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Vibor iz dvuh tablits ...

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Russian
View previous topic :: View next topic  
Author Message
globus
Smarty n00b


Joined: 12 Sep 2007
Posts: 2

PostPosted: Wed Sep 12, 2007 8:40 pm    Post subject: Vibor iz dvuh tablits ... Reply with quote

pozaluista podskazite...
Est 2 tablitsi
1) table_add :
id|cat_id|published
1| 1 |0

2) table_cat
id|name|published
1|Cat1 |1

gde cat_id(iz table_add)= id(iz table_cat)

chto mne ispolzovat` dlja viborki iz bazq dannqh, dlja pokaza imeni kategorii?
Esli mozno nebolshoi primer.


Last edited by globus on Wed May 05, 2010 11:15 pm; edited 1 time in total
Back to top
View user's profile Send private message
sergNN
Smarty Rookie


Joined: 10 Oct 2006
Posts: 12
Location: Bad Homburg

PostPosted: Tue Sep 18, 2007 1:25 pm    Post subject: Reply with quote

???? ???? ???? ??? (??? ? ??? ?????????) :

select a.id, a.cat_id, name, a.published
from
table_add a, table_cat b
where
b.id=a.cat_id

??? ??? ??????? ??????? - ?????????????, ??? ??? ???? cat_id ???? ?????? ? ??????? table_cat.
???? ?????? ????, ?? ??? ????? ???? ?????? (?? ????? ?? ????? ??????), ?? ?????????

select
a.id, a.cat_id, nvl(name, "undefined"), a.published
from
table_add a, table_cat b
where
b.id=a.cat_id

???? ?????? ????? ?? ????, ?? ????????? join (??????? ?????? ???? ????, ??? ??? ?????), ???? ???????????? ??? ?????? ?? ?????? ???????. ?? ??????, ??? ?????????? join ? ?????? ? ? Mysql ??????.
Back to top
View user's profile Send private message
sergNN
Smarty Rookie


Joined: 10 Oct 2006
Posts: 12
Location: Bad Homburg

PostPosted: Tue Sep 18, 2007 1:27 pm    Post subject: Reply with quote

???? ???? ???? ??? (??? ? ??? ?????????) :
Code:

select a.id, a.cat_id, name, a.published
from
table_add a, table_cat b
where
b.id=a.cat_id


??? ??? ??????? ??????? - ?????????????, ??? ??? ???? cat_id ???? ?????? ? ??????? table_cat.
???? ?????? ????, ?? ??? ????? ???? ?????? (?? ????? ?? ????? ??????), ?? ?????????
Code:

select
  a.id, a.cat_id, nvl(name, "undefined"), a.published
from
  table_add a, table_cat b
where
  b.id=a.cat_id


???? ?????? ????? ?? ????, ?? ????????? join (??????? ?????? ???? ????, ??? ??? ?????), ???? ???????????? ??? ?????? ?? ?????? ???????. ?? ??????, ??? ?????????? join ? ?????? ? ? Mysql ??????.
Back to top
View user's profile Send private message
sergNN
Smarty Rookie


Joined: 10 Oct 2006
Posts: 12
Location: Bad Homburg

PostPosted: Tue Sep 18, 2007 1:27 pm    Post subject: Reply with quote

Code:

???? ???? ???? ??? (??? ? ??? ?????????) :

select a.id, a.cat_id, name, a.published
from
table_add a, table_cat b
where
b.id=a.cat_id

??? ??? ??????? ??????? - ?????????????, ??? ??? ???? cat_id ???? ?????? ? ??????? table_cat.
???? ?????? ????, ?? ??? ????? ???? ?????? (?? ????? ?? ????? ??????), ?? ?????????

select
  a.id, a.cat_id, nvl(name, "undefined"), a.published
from
  table_add a, table_cat b
where
  b.id=a.cat_id

???? ?????? ????? ?? ????, ?? ????????? join (??????? ?????? ???? ????, ??? ??? ?????), ???? ???????????? ??? ?????? ?? ?????? ???????. ?? ??????, ??? ?????????? join ? ?????? ? ? Mysql ??????.
Back to top
View user's profile Send private message
serious_sam
Smarty n00b


Joined: 04 Jun 2008
Posts: 3

PostPosted: Wed Jun 04, 2008 4:14 pm    Post subject: Reply with quote

spasibo
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Russian All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP