|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
table and select
Hello,
Say I have a table FRUIT defined as: f_id primary key autoincrement f_field1 f_field2 .. .. f_fruit_type .. I could do: "select * from table FRUIT where f_fruit_type = 'apple'"; and that is FIRST WAY to do it. Now another way is whenever someone input and insert a row into table FRUIT that has fruit type = 'apple', I will insert also into TABLE APPL, defined as ap_id primary key autoincrement ap_fruit_id //foreign key is f_id as above Then to list all rows that fruit type = 'apple' in table FRUIT, I do: "SELECT f.* FROM table FRUIT f, APPL a WHERE f.f_id = a.ap_fruit_id " OK, so this is the SECOND WAY to find fruit type = 'apple', but it requires 2 tables. Which way is more efficient and better? Thanks, John Last edited by johnn : November 1st, 2002 at 04:03 AM. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > table and select |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|