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 |
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2009-04-02 : 02:40:04
|
| Here With Me Some Problem i Have A table Which Conatians data As The columns name in rows and another table in which these are columns like,,,Table:: MasterAllsid scol sdecs1 sname contain name2 sadd contain add3 sfname contain fnameand i have also other table like ,,,,,Table :: DataALLsid sname snamedesc sadd2 scadddesc sfname sfnamedesc1 Ashish Some Data 353 EPIP Some Data Sh Vijay somedata2 Some Data Some Data Some Data Some Data Some Data Some Data3 Some Data Some Data Some Data Some Data Some Data Some DataMean For Every Row in Table:: MASTERALL Table ::DATAALL has 2 columns so i like to maintain some relation in these tables from which i like to extract all the data from table :: DATALL when i select some value from table:: MASTERALLlike when i select in MasterALL table so i like to get back results from table DATAALL sname and snamedesc columns to return back,,,May be i make u understand my problem ... i just want to get any relation in these tables so i extract data from these tables..Thanks... |
|
|
tosscrosby
Aged Yak Warrior
676 Posts |
Posted - 2009-04-02 : 11:01:58
|
| In reality, I think YOU need to tell us what the relationship is, it is your table and data. Secondly, some realistic data will help a little too (some data, some data just doesn't cut it). Just a quick glance, but is masterall.sid = dataall.sid? if so, will the following script do? I can't be certain because you haven't provided enough information of any value.#1:select m.sid, d.sname, d.snamedescfrom masterall mleft outer join dataall don m.sid = d.sidOR#2:select m.sid, d.sname, d.snamedescfrom masterall mleft outer join dataall don m.sid = d.sidand m.scol = d.snameAlthough, based on your sample data, I don't think #2 works.Terry-- Procrastinate now! |
 |
|
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2009-04-03 : 00:08:52
|
| I just want if in MASTERALL table i pass a variable from my FRont End Application called SName or masterall.sid=1 then i want to retrive all the records from the table DATAALL in the column SNAME ans SNAMDESC...May be this time i make you understand what i want....Thanks For Reply... |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-04-03 : 13:02:31
|
| sorry your description does make it clear still. can you at least give your expected output out of above sample data? |
 |
|
|
|
|
|
|
|