Created
July 10, 2013 12:51
-
-
Save romaninsh/5966033 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select `profile`.`id`,`profile`.`element_type`,`profile`.`element_class`,`profile`.`name`,`profile`.`created_by`,(select `user`.`name` from `user` where `user`.`is_deleted` = 0 and `profile`.`created_by` = `user`.`id` ) `created`,`profile`.`descr`,`profile`.`is_show`,`profile`.`created_dts`,(select count(*) from `follower` where `follower`.`element_id` = `profile`.`id` ) `followers`,`profile`.`category_id`,(select `category`.`name` from `category` where `profile`.`category_id` = `category`.`id` ) `category`,`profile`.`picture_id`,(select concat("/elexu/prototype/", `_f`.`dirname`, "/", `filestore_file`.`filename`) `url` from `filestore_file` left join `filestore_volume` as `_f` on `_f`.`id` = `filestore_file`.`filestore_volume_id` inner join `filestore_image` as `_f_3` on `_f_3`.`original_file_id` = `filestore_file`.`id` where `profile`.`picture_id` = `filestore_file`.`id` ) `picture`,(select (select concat("/elexu/prototype/", `_f`.`dirname`, "/", `filestore_file`.`filename`) `url` from `filestore_file` left join `filestore_volume` as `_f` on `_f`.`id` = `filestore_file`.`filestore_volume_id` where `filestore_file`.`id` = `_f_5`.`thumb_file_id` ) `thumb_url` from `filestore_file` left join `filestore_volume` as `_f_4` on `_f_4`.`id` = `filestore_file`.`filestore_volume_id` inner join `filestore_image` as `_f_5` on `_f_5`.`original_file_id` = `filestore_file`.`id` where `filestore_file`.`id` = `profile`.`picture_id` ) `picture_thumb`,(select (select concat("/elexu/prototype/", `_f_8`.`dirname`, "/", `filestore_file`.`filename`) `url` from `filestore_file` left join `filestore_volume` as `_f_8` on `_f_8`.`id` = `filestore_file`.`filestore_volume_id` where `_f_7`.`thumb_48_id` = `filestore_file`.`id` ) `thumb_48` from `filestore_file` left join `filestore_volume` as `_f_6` on `_f_6`.`id` = `filestore_file`.`filestore_volume_id` inner join `filestore_image` as `_f_7` on `_f_7`.`original_file_id` = `filestore_file`.`id` where `filestore_file`.`id` = `profile`.`picture_id` ) `thumb_48`,(select (select concat("/elexu/prototype/", `_f_11`.`dirname`, "/", `filestore_file`.`filename`) `url` from `filestore_file` left join `filestore_volume` as `_f_11` on `_f_11`.`id` = `filestore_file`.`filestore_volume_id` where `_f_10`.`thumb_64_id` = `filestore_file`.`id` ) `thumb_64` from `filestore_file` left join `filestore_volume` as `_f_9` on `_f_9`.`id` = `filestore_file`.`filestore_volume_id` inner join `filestore_image` as `_f_10` on `_f_10`.`original_file_id` = `filestore_file`.`id` where `filestore_file`.`id` = `profile`.`picture_id` ) `thumb_64`,(select (select concat("/elexu/prototype/", `_f_14`.`dirname`, "/", `filestore_file`.`filename`) `url` from `filestore_file` left join `filestore_volume` as `_f_14` on `_f_14`.`id` = `filestore_file`.`filestore_volume_id` where `_f_13`.`thumb_128_id` = `filestore_file`.`id` ) `thumb_128` from `filestore_file` left join `filestore_volume` as `_f_12` on `_f_12`.`id` = `filestore_file`.`filestore_volume_id` inner join `filestore_image` as `_f_13` on `_f_13`.`original_file_id` = `filestore_file`.`id` where `filestore_file`.`id` = `profile`.`picture_id` ) `thumb_128`,`profile`.`state`,`_p`.`type`,`_p`.`points`,`_p`.`tmp_location`,`_p`.`tmp_moto`,`_p`.`demographics`,`_p`.`twitter`,`_p`.`facebook`,`_p`.`linked_in`,`_p`.`instagram`,`_p`.`news_feed_dts`,`_p`.`url`,`_p`.`profile_identity_id`,(select `profile_identity`.`name` from `profile_identity` where `_p`.`profile_identity_id` = `profile_identity`.`id` ) `profile_identity`,`_p`.`profile_education_id`,(select `profile_education`.`name` from `profile_education` where `_p`.`profile_education_id` = `profile_education`.`id` ) `profile_education`,`_p`.`profile_lifestage_id`,(select `profile_lifestage`.`name` from `profile_lifestage` where `_p`.`profile_lifestage_id` = `profile_lifestage`.`id` ) `profile_lifestage`,(select count(*) from `follower` where `follower`.`profile_id` = `profile`.`id` ) `followings`,`profile`.`last_portf1_id`,(select `portfolio`.`name` from `element` `portfolio` inner join `portfolio` as `_p_15` on `_p_15`.`id` = `portfolio`.`id` where `portfolio`.`element_type` = "portfolio" and `profile`.`last_portf1_id` = `portfolio`.`id` order by `_p_15`.`ord` ) `last_portf1`,`_p`.`id` `_p` from `element` `profile` inner join `profile` as `_p` on `_p`.`id` = `profile`.`id` where `profile`.`element_type` = "profile" and `profile`.`created_by` = "1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
select
profile
.id
,profile
.element_type
,profile
.element_class
,profile
.name
,profile
.created_by
,(selectuser
.name
fromuser
whereuser
.is_deleted
= 0 andprofile
.created_by
=user
.id
)created
,profile
.descr
,profile
.is_show
,profile
.created_dts
,(select count() fromfollower
wherefollower
.element_id
=profile
.id
)followers
,profile
.category_id
,(selectcategory
.name
fromcategory
whereprofile
.category_id
=category
.id
)category
,profile
.picture_id
,(select concat("/elexu/prototype/",_f
.dirname
, "/",filestore_file
.filename
)url
fromfilestore_file
left joinfilestore_volume
as_f
on_f
.id
=filestore_file
.filestore_volume_id
inner joinfilestore_image
as_f_3
on_f_3
.original_file_id
=filestore_file
.id
whereprofile
.picture_id
=filestore_file
.id
)picture
,(select (select concat("/elexu/prototype/",_f
.dirname
, "/",filestore_file
.filename
)url
fromfilestore_file
left joinfilestore_volume
as_f
on_f
.id
=filestore_file
.filestore_volume_id
wherefilestore_file
.id
=_f_5
.thumb_file_id
)thumb_url
fromfilestore_file
left joinfilestore_volume
as_f_4
on_f_4
.id
=filestore_file
.filestore_volume_id
inner joinfilestore_image
as_f_5
on_f_5
.original_file_id
=filestore_file
.id
wherefilestore_file
.id
=profile
.picture_id
)picture_thumb
,(select (select concat("/elexu/prototype/",_f_8
.dirname
, "/",filestore_file
.filename
)url
fromfilestore_file
left joinfilestore_volume
as_f_8
on_f_8
.id
=filestore_file
.filestore_volume_id
where_f_7
.thumb_48_id
=filestore_file
.id
)thumb_48
fromfilestore_file
left joinfilestore_volume
as_f_6
on_f_6
.id
=filestore_file
.filestore_volume_id
inner joinfilestore_image
as_f_7
on_f_7
.original_file_id
=filestore_file
.id
wherefilestore_file
.id
=profile
.picture_id
)thumb_48
,(select (select concat("/elexu/prototype/",_f_11
.dirname
, "/",filestore_file
.filename
)url
fromfilestore_file
left joinfilestore_volume
as_f_11
on_f_11
.id
=filestore_file
.filestore_volume_id
where_f_10
.thumb_64_id
=filestore_file
.id
)thumb_64
fromfilestore_file
left joinfilestore_volume
as_f_9
on_f_9
.id
=filestore_file
.filestore_volume_id
inner joinfilestore_image
as_f_10
on_f_10
.original_file_id
=filestore_file
.id
wherefilestore_file
.id
=profile
.picture_id
)thumb_64
,(select (select concat("/elexu/prototype/",_f_14
.dirname
, "/",filestore_file
.filename
)url
fromfilestore_file
left joinfilestore_volume
as_f_14
on_f_14
.id
=filestore_file
.filestore_volume_id
where_f_13
.thumb_128_id
=filestore_file
.id
)thumb_128
fromfilestore_file
left joinfilestore_volume
as_f_12
on_f_12
.id
=filestore_file
.filestore_volume_id
inner joinfilestore_image
as_f_13
on_f_13
.original_file_id
=filestore_file
.id
wherefilestore_file
.id
=profile
.picture_id
)thumb_128
,profile
.state
,_p
.type
,_p
.points
,_p
.tmp_location
,_p
.tmp_moto
,_p
.demographics
,_p
.twitter
,_p
.facebook
,_p
.linked_in
,_p
.instagram
,_p
.news_feed_dts
,_p
.url
,_p
.profile_identity_id
,(selectprofile_identity
.name
fromprofile_identity
where_p
.profile_identity_id
=profile_identity
.id
)profile_identity
,_p
.profile_education_id
,(selectprofile_education
.name
fromprofile_education
where_p
.profile_education_id
=profile_education
.id
)profile_education
,_p
.profile_lifestage_id
,(selectprofile_lifestage
.name
fromprofile_lifestage
where_p
.profile_lifestage_id
=profile_lifestage
.id
)profile_lifestage
,(select count() fromfollower
wherefollower
.profile_id
=profile
.id
)followings
,profile
.last_portf1_id
,(selectportfolio
.name
fromelement
portfolio
inner joinportfolio
as_p_15
on_p_15
.id
=portfolio
.id
whereportfolio
.element_type
= "portfolio" andprofile
.last_portf1_id
=portfolio
.id
order by_p_15
.ord
)last_portf1
,_p
.id
_p
fromelement
profile
inner joinprofile
as_p
on_p
.id
=profile
.id
whereprofile
.element_type
= "profile" andprofile
.created_by
= "1"