Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7727801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:33:14+00:00 2026-06-01T05:33:14+00:00

Got these 2 queries: select d1.field_id_41 program_code, d1.field_id_48 program_group_code, t1.title program_lookup, t2.title group_title, t1.url_title

  • 0

Got these 2 queries:

select d1.field_id_41 program_code, d1.field_id_48 program_group_code, t1.title program_lookup, t2.title group_title, 
       t1.url_title program_url_title, t2.url_title program_group_url_title
from channel_titles t1 
join channel_data d1   on t1.entry_id    = d1.entry_id
join channel_data d2   on d1.field_id_48 = d2.field_id_47
join channel_titles t2 on t2.entry_id    = d2.entry_id
where t1.channel_id = 26 and d1.field_id_41 != ''
order by d2.field_id_45 , d1.field_id_9


select ProgramCode, ProgramGroup, EventCode, FormalDate, LocCity, LocState, LocAddress, LocName, Price, 
       zl.latitude as LocLatitude, zl.longitude as LocLongitude
from course_events e
join channel_data   d on e.ProgramCode = d.field_id_41
join channel_titles t on d.entry_id    = t.entry_id
join zip_lat_long  zl on zl.zip        = e.LocZipCode

Currently, the first query is used to populate three JSON objects called program_lookup, program_url_titles and program_group_url_titles.
And then items returned from the second query, also placed in a JSON object called event, are iterated and then portions of the results are shown in my HTML along with items from the lookup caches based on data in the events JSON object like this:

html = html + hr + '<div class="course"><div class="col1' + tm10 +  '"><h4>' + program_lookup[event['ProgramCode']] +  '</h4></div>';
html = html + '<div class="col1"><b>' + event['LocCity'] + '</b><br/>' + '... <a href="/courses/' +  program_group_url_titles[event['ProgramGroup']] + '/'+  program_url_titles[event['ProgramCode']]+ '/' + event['EventCode'] + '" target="_new">View Details</a></div><div class="col2">';

I need to combine these into one query to get rid of the three lookup objects but am unsure if it would be very efficient or really how to go about doing this.
What this is going to allow me to do is use this utility, http://jsonselect.org, to basically filter items before they are shown in my HTML.
The reason why I need this is that I need to show certain items before all the others and placing them in the correct order cannot be done in the SQL.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T05:33:16+00:00Added an answer on June 1, 2026 at 5:33 am

    Those select statements don’t match, so combining them is probably not what you want to do. One example of where you could combine two select statements would be a union all where your select clause matches:

    select a, b, c from table1
        union all
    select a, b, c from table2
    

    You should add more detail about your client side requirements, but you can always combine multiple objects into a JSON object as follows. Let’s say you had 2 objects:

    [{'name':'dan','dog':'spot'},{'name':'sarah','dog':'rex'}]
    {'names':['dan','sarah']}
    

    You could merge them into 1:

    {'detail':[{'name':'dan','dog':'spot'},{'name':'sarah','dog':'rex'}],'justNames':{'names':['dan','sarah']}}
    

    You can understand JSON as a simple object notation if you carefully read the first three diagrams on the official json page: http://www.json.org/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got these two queries: SELECT SELECT NamesRecord.NameID, NamesRecord.FulfillmentAddressID NameFulfillmentAddressID, ContractRecord.FulfillmentAddressID, ContractRecord.BillingAddressId FROM Magnet.dbo.ContractRecord
I got two queries: SELECT `type`, COUNT(`id`) AS 'type' FROM `items` WHERE `post` =
I've got these models class PlayersToTeam < ActiveRecord::Base belongs_to :player belongs_to :team accepts_nested_attributes_for :player
I have trained xor neural network in MATLAB and got these weights: iw: [-2.162
While answering this question, I got these confusing results: double d = 0.49999999999999990d; //output
I've got a simple WPF dialog with these two controls: <TextBox Text={Binding MyText}/> <Button
I got two apps, with these package names: com.blah.a com.blah.b They got the sharedUserId
I've got a solution with many projects One of these proejcts is a MyProject.Web
I've got a sql query (using MS-SQL 2005) that generates data with these columns:
I've got a site that provides blog-friendly widgets via JavaScript. These work fine in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.