I need to write a MySQL join query for retrieve project information as this image below.
project manager able to get list of each developer's workingHours, Overtime, Descriptions, Contributions for specific project his assigned. This is my database table structure.
Can anyone tell me how to to this? I need output like this image using this table structure.
Related
Table Image.
I want to distribute the data of above table into multiple tables.
Say :-
Product name and Company goes into 1st table.
Barcode and Price goes into 2nd table.
Category and Subcategory goes into 3rdtable.
One approach to solve your problem would be to implement a custom management command, you can check the documentation here. You could parse the CSV and then update the specific entries on your database.
The usage would be something like this (assuming for example that the command is called updateproducts):
$ python manage.py updateproducts path/to/your/file.csv
Of course that depending on the size of your data, other approaches might be more efficient.
I have the following in database
status table - status_id, status_body, status_date
student table - student_id, student_username, student_firstname, student_lastname
follow table - followId, follow_followerid, follow_followingid`
Now, I want to show the status of the users which a user(say user A) currently follows along with his(user A) own status updates.
How can I do it in cshtml? SQL query for this is necessary.
Any help?
You can't put a sql query in a cshtml file. There is a chain of events that have to happen. You serve the cshtml with only the results of your database query in it. You also need some server-side code to serve the cshtml, for example c# using MVC. And you need a way to access your database, for example an object-relational mapper such as Entity Framework. You have a lot of steps, if you want to make this work.
I've been trying to get this SQL query running for a while now and can't seem to get the last little bit going.
The backend database to all this data is a Drupal install with data spread out across a number of modules, so I need to do a lot of joining to get a certain view table set up that I need for a third-party application.
It's hard to explain the entire schema, but here's the sqlfiddle:
http://sqlfiddle.com/#!2/68df0/2/0
So basically, I have a userid which I map to a profile id through a join. Then I need to use that profile ID to pull the related data about that profile from two other tables. (there should only be one row with each pid in each of the other tables)
So in the end, I would like to see a table with username, othername, and key_id.
I got the first two pieces in there, but just can't seem to figure out how to join in the othername, and keep getting null.
The server is running MySQL.
Thanks guys!
LEFT JOIN other_name
ON profile_link.pid=other_name.pid;
I have a bit of a complex issue to deal with here at the moment and would love some help please.
I have exported data from SugarCRM in CSV format to be imported in to my new app. Now my app works slightly differently in terms of database schema. I use auto-incrementing integers for id's where as SugarCRM uses long alphanumeric strings like dc4c072c-ec0e-26b6-8780-4a9e7ec8375d.
I need to be able to take the data for say accounts and contacts, using the SugarCRM pivot table export from accounts_contacts, and change the id's, while keeping them all linked correctly. I then need to use the changed data to import in to my database, where each record in the contacts table contains an account_id field which links them to accounts, rather than a pivot table.
Now, my first thoughts would be to import all the required data in to clean database and use a lookup table with four fields in it to change the id's. So I would have old_account_id, new_account_id, old_contact_id, new_contact_id. I'd then use that table to find the right id's and amend the data.
The only issue I have with this, is that my SQL isn't amazing, so I'm having difficulty visualising and writing the query to use the lookup table and change the data. So I would love some help with this.
Also, once I have the query and the correct amended data, I need another query to then create the contacts table using an account_id field from the pivot table.
Hope you guys can help out. Thanks in advance.
Are you planning on keeping the data in sync? I'd suggest adding a "sugar_id" column in your app and a "your_app_id" column in SugarCRM. This way the native id column remains the same and that it will maintain a reference to the record in the other system.
Here is the situation I'm in:
I just implemented a DNN site. I already have a huge database table of users. Now when my users come in to register for my DNN site, they're required to put in a first name, last name and DOB. I will then use this information to match their records to the existing user table via a SQL query. The only problem is I can't find "DOB" field anywhere, in any table or for that matter most of the rest of the profile information. Is it even stored in the database? or am I just blind?
The best answer I could find was from a dnn forum which stated
"User profile information is stored in several tables in the database. The 'Users' table is the place to start for basic information. There are several tables that have "profile" in the name that also are important."
I've looked through almost every table in the database, but with no luck...
I'm using DNN 6.0 with SQL Server 2008
I've looked everywhere but can't find it. Any help or guidance from anyone would be much appreciated! Even a paid solution like a pre-built module would work.
Thanks
Look in the ProfilePropertyDefinition table for the PropertyDefinitionId of the dateOfBirth property. Then, with that id, and the id of the user, you can query the UserProfile table to retrieve the value.
There is more at this blog post
http://erikvanballegoij.com/Home/itemid/28/Selecting-profile-properties-the-easy-way