https://antibiotiqueaugmentin.com/surdosage-augmentin-bebe/
× This is the optional Forum header for the Suggestion Box.

Pulling from Multiple tables in a database

More
13 years 8 months ago #734

Hi, no this doesn't do it. I want to get a value from a user using a simple textbox then plug that value into the WHERE clause BEFORE the grid is populated. In other words, Dynamic SQL.

Any idea if/when you would do this (if at all)

I also see issues with using substring and other functions as well as renaming display columns using the tool (results in no data).

Please Log in or Create an account to join the conversation.

  • Terry
  • Terry's Avatar
  • Visitor
  • Visitor
13 years 1 month ago #987

No problem making the SQL code. Here's a query that does exactly what I want it to do.

SELECT jos_fastball_schedule.id, description, jos_fastball_team.name, gamedatetime, field
FROM jos_fastball_schedule
INNER JOIN jos_fastball_team ON hometeam = jos_fastball_team.id
INNER JOIN jos_fastball_location ON location = jos_fastball_location.id
INNER JOIN jos_fastball_gametype ON gametype = jos_fastball_gametype.id
ORDER BY gamedatetime DESC

So how the heck do incorporate it in TABLE JX????

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #989

Create view with:

CREATE VIEW MyView AS
SELECT jos_fastball_schedule.id, description, jos_fastball_team.name, gamedatetime, field
FROM jos_fastball_schedule
INNER JOIN jos_fastball_team ON hometeam = jos_fastball_team.id
INNER JOIN jos_fastball_location ON location = jos_fastball_location.id
INNER JOIN jos_fastball_gametype ON gametype = jos_fastball_gametype.id
ORDER BY gamedatetime DESC

Than use MyView with Table JX

dev.mysql.com/doc/refman/5.0/en/create-view.html

Regards,
Tomaž

Please Log in or Create an account to join the conversation.

  • jonas
  • jonas's Avatar
  • Visitor
  • Visitor
12 years 9 months ago #1128

Hi,

I take it that creating a view is a one time event. But what if my data changes periodically and I need to update the view accordingly?

Regards,

Jonas

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #1129

There is no need to worry about it. Every time you call a view the data from original tables is pulled.

Please Log in or Create an account to join the conversation.

  • jonas
  • jonas's Avatar
  • Visitor
  • Visitor
12 years 9 months ago #1136

Thank you Tomaz,

Will try it out.

Regards,

Jonas

Please Log in or Create an account to join the conversation.

Moderators: tomaz
Time to create page: 0.195 seconds

Contact Us

Contact us on Discord

Contact us on Facebook