- 1
SELECT SQL_CALC_FOUND_ROWS *,cached_login as login,cached_name as uname,comment_count as ccount FROM posts p WHERE exists (select * from tags tg, tegi_zapisi tx where tg.alt_title like 'post' and tg.id_tag=tx.id_tag and tx.id_post=p.id_post) and exists (select * from tags tg, tegi_zapisi tx where tg.alt_title like 'opentomsk' and tg.id_tag=tx.id_tag and tx.id_post=p.id_post) and hide<>1 ORDER BY p.date desc, p.time desc LIMIT 210,10
guest 08.08.2009 23:44 # −2
SELECT SQL_CALC_FOUND_ROWS *,cached_login as login,cached_name as uname,comment_count as ccount FROM posts p WHERE exists (select * from tags tg, tegi_zapisi tx where tg.alt_title like 'post' and tg.id_tag=tx.id_tag and tx.id_post=p.id_post) and exists (select * from tags tg, tegi_zapisi tx where tg.alt_title like 'opentomsk' and tg.id_tag=tx.id_tag and tx.id_post=p.id_post) and hide<>1 ORDER BY p.date desc, p.time desc LIMIT 210,10
guest 10.08.2009 20:54 # −4
guest 10.08.2009 21:31 # +1
> и плохочитаемый а так же
> плохомонимаемый язык
Ага, точно, для гуманоида, долбящегося в императивные языки.
SQL на самом деле классный язык, потому что им не надо выражать "как?", а достаточно лишь "что?"
Другое дело, что нет единой нормальной реализации.
guest 10.08.2009 23:09 # −1
UNV 11.08.2009 10:15 # +1
SELECT
SQL_CALC_FOUND_ROWS *,
cached_login as login,
cached_name as uname,
comment_count as ccount
FROM posts p
WHERE
exists
(
select *
from
tags tg,
tegi_zapisi tx
where
tg.alt_title like 'post'
and tg.id_tag = tx.id_tag
and tx.id_post = p.id_post
)
and exists
(
select *
from
tags tg,
tegi_zapisi tx
where
tg.alt_title like 'opentomsk'
and tg.id_tag = tx.id_tag
and tx.id_post = p.id_post
)
and hide <> 1
ORDER BY p.date desc, p.time desc
LIMIT 210, 10
UNV 11.08.2009 10:16 # −1
Oleg_quadro 11.08.2009 23:08 # −1
SELECT
__SQL_CALC_FOUND_ROWS *,
__cached_login as login