Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
breaker098
Starting Member
2 Posts |
Posted - 2008-03-24 : 15:26:44
|
| I'm trying to take the 2nd block of SQL and implement it into the first so that I can have a correlated subquery. Can anyone help me with formatting this or at lease getting closer? I'm lost!select * from st_Meta_Field MFINNER JOIN st_field F ON MF.Field_ID = F.Field_IDwhere F.Table_ID = 5 AND (F.Field_Name = 'XXX' OR F.Field_Name = 'YYY') AND F.Record_State = 1 AND MF.Record_State = 1select max(display_row),subset_valuefrom st_Meta_Field where table_id = 5 AND Display_Row < 500group by Subset_Value |
|
|
Bustaz Kool
Master Smack Fu Yak Hacker
1834 Posts |
Posted - 2008-03-24 : 15:52:40
|
| What did you want to corellate it on?=======================================Do something for somebody every day for which you do not get paid. -Albert Schweitzer, philosopher, physician, musician, Nobel laureate (1875-1965) |
 |
|
|
breaker098
Starting Member
2 Posts |
Posted - 2008-03-24 : 16:04:57
|
| select max(display_row),subset_valuefrom st_Meta_Field where table_id = 5 AND Display_Row < 500group by Subset_ValueThis SQL chunk returns the max display row and subsetselect * from st_Meta_Field MFINNER JOIN st_field F ON MF.Field_ID = F.Field_IDwhere F.Table_ID = 5 AND (F.Field_Name = 'XXX' OR F.Field_Name = 'YYY')AND F.Record_State = 1 AND MF.Record_State = 1This SQL chunk simply joins the two tables based and returns the data for the two fields.Ultimately what I would like to do is update the display row for these two fields based on the current max display row is already at. |
 |
|
|
|
|
|